/** * @param state Current state. * @param discoCache Discovery data cache. */ TransitionOnJoinWaitFuture(DiscoveryDataClusterState state, DiscoCache discoCache) { assert state.transition() : state; transitionNodes = U.newHashSet(state.transitionNodes().size()); for (UUID nodeId : state.transitionNodes()) { if (discoCache.node(nodeId) != null) transitionNodes.add(nodeId); } }
/** {@inheritDoc} */ @Override @Nullable public ChangeGlobalStateFinishMessage onNodeLeft(ClusterNode node) { if (globalState.transition()) { Set<UUID> nodes = globalState.transitionNodes(); if (nodes.remove(node.id()) && nodes.isEmpty()) { U.warn(log, "Failed to change cluster state, all participating nodes failed. " + "Switching to inactive state."); ChangeGlobalStateFinishMessage msg = new ChangeGlobalStateFinishMessage(globalState.transitionRequestId(), false, false); onStateFinishMessage(msg); return msg; } } return null; }
/** * @param state Current state. * @param discoCache Discovery data cache. */ TransitionOnJoinWaitFuture(DiscoveryDataClusterState state, DiscoCache discoCache) { assert state.transition() : state; transitionNodes = U.newHashSet(state.transitionNodes().size()); for (UUID nodeId : state.transitionNodes()) { if (discoCache.node(nodeId) != null) transitionNodes.add(nodeId); } }
/** {@inheritDoc} */ @Override @Nullable public ChangeGlobalStateFinishMessage onNodeLeft(ClusterNode node) { if (globalState.transition()) { Set<UUID> nodes = globalState.transitionNodes(); if (nodes.remove(node.id()) && nodes.isEmpty()) { U.warn(log, "Failed to change cluster state, all participating nodes failed. " + "Switching to inactive state."); ChangeGlobalStateFinishMessage msg = new ChangeGlobalStateFinishMessage(globalState.transitionRequestId(), false, false); onStateFinishMessage(msg); return msg; } } return null; }