public void setZkNode(KaaThriftService service, ConnectionInfo connectionInfo, WorkerNodeTracker zkNode) { setZkNode(getServerId(service, connectionInfo), zkNode); }
@Override public void setZkNode(OperationsNode operationsNode) { this.operationsNode = operationsNode; this.id = Neighbors.getServerId(this.operationsNode.getNodeInfo().getConnectionInfo()); neighbors.setZkNode( KaaThriftService.OPERATIONS_SERVICE, this.operationsNode.getNodeInfo().getConnectionInfo(), operationsNode); if (resolver != null) { updateResolver(this.resolver); } }
/** * Check neighbors. */ private void checkNeighbors() { if (neighbors == null) { synchronized (zkLock) { if (neighbors == null) { neighbors = new Neighbors<>( KaaThriftService.OPERATIONS_SERVICE, new NeighborTemplate<OperationsServiceMsg>() { @Override public void process(Iface client, List<OperationsServiceMsg> messages) throws TException { OperationsServiceMsg.dispatch(client, messages); } @Override public void onServerError(String serverId, Exception ex) { LOG.error("Can't send configuration update to {}", serverId, ex); } }, neighborConnectionsSize); ControlNode zkNode = controlZkService.getControlZkNode(); neighbors.setZkNode( KaaThriftService.KAA_NODE_SERVICE, zkNode.getControlServerInfo().getConnectionInfo(), zkNode); } } } }
@Override public void setZkNode(OperationsNode operationsNode) { this.operationsNode = operationsNode; this.id = Neighbors.getServerId( KaaThriftService.OPERATIONS_SERVICE, this.operationsNode.getNodeInfo().getConnectionInfo()); neighbors.setZkNode( KaaThriftService.OPERATIONS_SERVICE, this.operationsNode.getNodeInfo().getConnectionInfo(), operationsNode); if (resolver != null) { updateResolver(this.resolver); } }