/** * Shutdown all neighbors connections and cancel timer task if exist. */ public void shutdown() { for (NeighborConnection<T, V> neigbor : neigbors.values()) { LOG.info("Shuting down neighbor connection {}", neigbor.getId()); neigbor.shutdown(); } neigbors.clear(); }
@Override public void onNodeRemoved(OperationsNodeInfo nodeInfo) { String opId = getServerId(nodeInfo.getConnectionInfo()); if (!zkId.equals(opId)) { NeighborConnection<T, V> connection = neigbors.remove(opId); if (connection != null) { connection.shutdown(); } LOG.info("Operations server {} removed to {} Neighbors list ({}). Now {} neighbors", opId, neigbors.size()); } } });