/** * Creates a non-transitional cluster state. This method effectively cleans all fields identifying the * state as transitional and creates a new state with the state transition result. * * @param success Transition success status. * @return Cluster state that finished transition. */ public DiscoveryDataClusterState finish(boolean success) { return success ? new DiscoveryDataClusterState( null, active, baselineTopology, null, null, null ) : prevState != null ? prevState : DiscoveryDataClusterState.createState(false, null); }
/** {@inheritDoc} */ @Override public DiscoveryDataClusterState pendingState(ChangeGlobalStateMessage stateMsg) { return DiscoveryDataClusterState.createState(stateMsg.activate() || stateMsg.forceChangeBaselineTopology(), stateMsg.baselineTopology()); }
/** */ private void onStateRestored(BaselineTopology blt) { DiscoveryDataClusterState state = globalState; if (!state.active() && !state.transition() && state.baselineTopology() == null) { DiscoveryDataClusterState newState = DiscoveryDataClusterState.createState(false, blt); globalState = newState; } }
/** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { inMemoryMode = !CU.isPersistenceEnabled(ctx.config()); // Start first node as inactive if persistence is enabled. boolean activeOnStart = inMemoryMode && ctx.config().isActiveOnStart(); globalState = DiscoveryDataClusterState.createState(activeOnStart, null); ctx.event().addLocalEventListener(lsr, EVT_NODE_LEFT, EVT_NODE_FAILED); }
/** * Creates a non-transitional cluster state. This method effectively cleans all fields identifying the * state as transitional and creates a new state with the state transition result. * * @param success Transition success status. * @return Cluster state that finished transition. */ public DiscoveryDataClusterState finish(boolean success) { return success ? new DiscoveryDataClusterState( null, active, baselineTopology, null, null, null ) : prevState != null ? prevState : DiscoveryDataClusterState.createState(false, null); }
/** {@inheritDoc} */ @Override public DiscoveryDataClusterState pendingState(ChangeGlobalStateMessage stateMsg) { return DiscoveryDataClusterState.createState(stateMsg.activate() || stateMsg.forceChangeBaselineTopology(), stateMsg.baselineTopology()); }
/** */ private void onStateRestored(BaselineTopology blt) { DiscoveryDataClusterState state = globalState; if (!state.active() && !state.transition() && state.baselineTopology() == null) { DiscoveryDataClusterState newState = DiscoveryDataClusterState.createState(false, blt); globalState = newState; } }
/** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { inMemoryMode = !CU.isPersistenceEnabled(ctx.config()); // Start first node as inactive if persistence is enabled. boolean activeOnStart = inMemoryMode && ctx.config().isActiveOnStart(); globalState = DiscoveryDataClusterState.createState(activeOnStart, null); ctx.event().addLocalEventListener(lsr, EVT_NODE_LEFT, EVT_NODE_FAILED); }