/** * Initialize the ha manager, i.e register the node listener to propagates the node events and * start the quorum timer. The quorum will be checked as well. */ void init() { synchronized (haInfo) { clusterMap.put(nodeID, haInfo.encode()); } clusterManager.nodeListener(new NodeListener() { @Override public void nodeAdded(String nodeID) { HAManager.this.nodeAdded(nodeID); } @Override public void nodeLeft(String leftNodeID) { HAManager.this.nodeLeft(leftNodeID); } }); quorumTimerID = vertx.setPeriodic(QUORUM_CHECK_PERIOD, tid -> checkHADeployments()); // Call check quorum to compute whether we have an initial quorum synchronized (this) { checkQuorum(); } }
/** * Initialize the ha manager, i.e register the node listener to propagates the node events and * start the quorum timer. The quorum will be checked as well. */ void init() { synchronized (haInfo) { clusterMap.put(nodeID, haInfo.encode()); } clusterManager.nodeListener(new NodeListener() { @Override public void nodeAdded(String nodeID) { HAManager.this.nodeAdded(nodeID); } @Override public void nodeLeft(String leftNodeID) { HAManager.this.nodeLeft(leftNodeID); } }); quorumTimerID = vertx.setPeriodic(QUORUM_CHECK_PERIOD, tid -> checkHADeployments()); // Call check quorum to compute whether we have an initial quorum synchronized (this) { checkQuorum(); } }