@Override public void onNodeRemoved(OperationsNodeInfo nodeInfo) { String dnsName = getNameFromConnectionInfo(nodeInfo.getConnectionInfo()); int accessPointId = ServerNameUtil.crc32(nodeInfo.getConnectionInfo()); opsServersMap.remove(accessPointId); LOG.info("Operations server [{}][{}] removed. Updating {} Bootstrap servers", accessPointId, dnsName, bootstrapsMap.size()); for (BootstrapNodeInfo bootstrapNodeInfo : bootstrapsMap.values()) { updateBootstrap(bootstrapNodeInfo); } }
@Override public void onNodeAdded(OperationsNodeInfo nodeInfo) { String dnsName = getNameFromConnectionInfo(nodeInfo.getConnectionInfo()); int accessPointId = ServerNameUtil.crc32(nodeInfo.getConnectionInfo()); addNewOperationsServer(accessPointId, dnsName, nodeInfo); LOG.info("Operations server [{}][{}] added. Updating {} Bootstrap servers", accessPointId, dnsName, bootstrapsMap.size()); for (BootstrapNodeInfo bootstrapNodeInfo : bootstrapsMap.values()) { updateBootstrap(bootstrapNodeInfo); } }
@Override public void onNodeUpdated(OperationsNodeInfo nodeInfo) { String dnsName = getNameFromConnectionInfo(nodeInfo.getConnectionInfo()); int accessPointId = ServerNameUtil.crc32(nodeInfo.getConnectionInfo()); LOG.info("Operations server [{}][{}] updated", accessPointId, dnsName); if (opsServersMap.containsKey(accessPointId)) { opsServersMap.get(accessPointId).history.addOpsServerLoad(nodeInfo.getLoadInfo()); } else { addNewOperationsServer(accessPointId, dnsName, nodeInfo); } }
private Set<ProtocolConnectionData> toProtocolConnectionData(OperationsNodeInfo node, TransportMetaData md, int version) { byte[] connectionData = null; Set<ProtocolConnectionData> result = new HashSet<>(); for (VersionConnectionInfoPair pair : md.getConnectionInfo()) { if (version == pair.getVersion()) { result.add(new ProtocolConnectionData(ServerNameUtil.crc32(node.getConnectionInfo()), new ProtocolVersionId(md.getId(), version), pair.getConenctionInfo().array()) ); } } return result; }
List<TransportMetaData> supportedChannels = node.getTransports(); int accessPointId = ServerNameUtil.crc32(node.getConnectionInfo());
List<TransportMetaData> supportedChannels = node.getTransports(); int accessPointId = ServerNameUtil.crc32(node.getConnectionInfo()); for (TransportMetaData transport : supportedChannels) { for (VersionConnectionInfoPair pair : transport.getConnectionInfo()) {