private void checkSubs(String failedNodeID) { if (clusterViewChangedHandler == null) { return; } String chosen = chooseHashedNode(null, failedNodeID.hashCode()); if (chosen != null && chosen.equals(this.nodeID)) { runOnContextAndWait(() -> clusterViewChangedHandler.accept(new HashSet<>(clusterManager.getNodes()))); } }
private void checkFailover(String failedNodeID, JsonObject theHAInfo) { try { JsonArray deployments = theHAInfo.getJsonArray("verticles"); String group = theHAInfo.getString("group"); String chosen = chooseHashedNode(group, failedNodeID.hashCode()); if (chosen != null && chosen.equals(this.nodeID)) { if (deployments != null && deployments.size() != 0) { log.info("node" + nodeID + " says: Node " + failedNodeID + " has failed. This node will deploy " + deployments.size() + " deploymentIDs from that node."); for (Object obj: deployments) { JsonObject app = (JsonObject)obj; processFailover(app); } } // Failover is complete! We can now remove the failed node from the cluster map clusterMap.remove(failedNodeID); runOnContextAndWait(() -> { if (failoverCompleteHandler != null) { failoverCompleteHandler.handle(failedNodeID, theHAInfo, true); } }); } } catch (Throwable t) { log.error("Failed to handle failover", t); runOnContextAndWait(() -> { if (failoverCompleteHandler != null) { failoverCompleteHandler.handle(failedNodeID, theHAInfo, false); } }); } }
private void checkSubs(String failedNodeID) { if (clusterViewChangedHandler == null) { return; } String chosen = chooseHashedNode(null, failedNodeID.hashCode()); if (chosen != null && chosen.equals(this.nodeID)) { runOnContextAndWait(() -> clusterViewChangedHandler.accept(new HashSet<>(clusterManager.getNodes()))); } }
private void checkFailover(String failedNodeID, JsonObject theHAInfo) { try { JsonArray deployments = theHAInfo.getJsonArray("verticles"); String group = theHAInfo.getString("group"); String chosen = chooseHashedNode(group, failedNodeID.hashCode()); if (chosen != null && chosen.equals(this.nodeID)) { if (deployments != null && deployments.size() != 0) { log.info("node" + nodeID + " says: Node " + failedNodeID + " has failed. This node will deploy " + deployments.size() + " deploymentIDs from that node."); for (Object obj: deployments) { JsonObject app = (JsonObject)obj; processFailover(app); } } // Failover is complete! We can now remove the failed node from the cluster map clusterMap.remove(failedNodeID); runOnContextAndWait(() -> { if (failoverCompleteHandler != null) { failoverCompleteHandler.handle(failedNodeID, theHAInfo, true); } }); } } catch (Throwable t) { log.error("Failed to handle failover", t); runOnContextAndWait(() -> { if (failoverCompleteHandler != null) { failoverCompleteHandler.handle(failedNodeID, theHAInfo, false); } }); } }