public class

StateModelDefinition

extends HelixProperty
java.lang.Object
   ↳ org.apache.helix.HelixProperty
     ↳ org.apache.helix.model.StateModelDefinition

Class Overview

Describe the state model

Summary

Nested Classes
class StateModelDefinition.Builder Construct a state model  
enum StateModelDefinition.StateModelDefinitionProperty  
[Expand]
Inherited Fields
From class org.apache.helix.HelixProperty
Public Constructors
StateModelDefinition(ZNRecord record)
Instantiate from a pre-populated record
Public Methods
String getInitialState()
Get the starting state in the model
State getNextStateForTransition(State fromState, State toState)
Get the intermediate state required to transition from one state to the other
String getNextStateForTransition(String fromState, String toState)
Get the intermediate state required to transition from one state to the other
String getNumInstancesPerState(String state)
Number of instances that can be in each state
String getNumParticipantsPerState(State state)
Number of participants that can be in each state
StateModelDefId getStateModelDefId()
Get a concrete state model definition id
List<String> getStateTransitionPriorityList()
Get an ordered priority list of transitions
List<String> getStatesPriorityList()
Get an ordered priority list of states
State getTypedInitialState()
Get the starting state in the model
List<Transition> getTypedStateTransitionPriorityList()
Get an ordered priority list of transitions
List<State> getTypedStatesPriorityList()
Get an ordered priority list of states
boolean isValid()
Get property validity
[Expand]
Inherited Methods
From class org.apache.helix.HelixProperty
From class java.lang.Object

Public Constructors

public StateModelDefinition (ZNRecord record)

Instantiate from a pre-populated record

Parameters
record ZNRecord representing a state model definition

Public Methods

public String getInitialState ()

Get the starting state in the model

Returns
  • name of the initial state

public State getNextStateForTransition (State fromState, State toState)

Get the intermediate state required to transition from one state to the other

Parameters
fromState the source
toState the destination
Returns
  • the intermediate state, or null if not present

public String getNextStateForTransition (String fromState, String toState)

Get the intermediate state required to transition from one state to the other

Parameters
fromState the source
toState the destination
Returns
  • the intermediate state

public String getNumInstancesPerState (String state)

Number of instances that can be in each state

Parameters
state the state name
Returns
  • maximum instance count per state, can be "N" or "R"

public String getNumParticipantsPerState (State state)

Number of participants that can be in each state

Parameters
state the state
Returns
  • maximum instance count per state, can be "N" or "R"

public StateModelDefId getStateModelDefId ()

Get a concrete state model definition id

Returns
  • StateModelDefId

public List<String> getStateTransitionPriorityList ()

Get an ordered priority list of transitions

Returns
  • transitions in the form SRC-DEST, the first of which is highest priority

public List<String> getStatesPriorityList ()

Get an ordered priority list of states

Returns
  • state names, the first of which is highest priority

public State getTypedInitialState ()

Get the starting state in the model

Returns
  • name of the initial state

public List<Transition> getTypedStateTransitionPriorityList ()

Get an ordered priority list of transitions

Returns
  • Transition objects, the first of which is highest priority (immutable)

public List<State> getTypedStatesPriorityList ()

Get an ordered priority list of states

Returns
  • immutable list of states, the first of which is highest priority (immutable)

public boolean isValid ()

Get property validity

Returns
  • true if valid, false if invalid