/** * @param active Current status. * @return State instance. */ static DiscoveryDataClusterState createState(boolean active, @Nullable BaselineTopology baselineTopology) { return new DiscoveryDataClusterState(null, active, baselineTopology, null, null, null); }
/** * 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); }
/** * @param active New status. * @param transitionReqId State change request ID. * @param transitionTopVer State change topology version. * @param transitionNodes Nodes participating in state change exchange. * @return State instance. */ static DiscoveryDataClusterState createTransitionState( DiscoveryDataClusterState prevState, boolean active, @Nullable BaselineTopology baselineTopology, UUID transitionReqId, AffinityTopologyVersion transitionTopVer, Set<UUID> transitionNodes ) { assert transitionReqId != null; assert transitionTopVer != null; assert !F.isEmpty(transitionNodes) : transitionNodes; assert prevState != null; return new DiscoveryDataClusterState( prevState, active, baselineTopology, transitionReqId, transitionTopVer, transitionNodes); }
/** * @param active Current status. * @return State instance. */ static DiscoveryDataClusterState createState(boolean active, @Nullable BaselineTopology baselineTopology) { return new DiscoveryDataClusterState(null, active, baselineTopology, null, null, null); }
/** * 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); }
/** * @param active New status. * @param transitionReqId State change request ID. * @param transitionTopVer State change topology version. * @param transitionNodes Nodes participating in state change exchange. * @return State instance. */ static DiscoveryDataClusterState createTransitionState( DiscoveryDataClusterState prevState, boolean active, @Nullable BaselineTopology baselineTopology, UUID transitionReqId, AffinityTopologyVersion transitionTopVer, Set<UUID> transitionNodes ) { assert transitionReqId != null; assert transitionTopVer != null; assert !F.isEmpty(transitionNodes) : transitionNodes; assert prevState != null; return new DiscoveryDataClusterState( prevState, active, baselineTopology, transitionReqId, transitionTopVer, transitionNodes); }