public class

StateModelDefinition

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

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
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
List<String> getStateTransitionPriorityList()
Get an ordered priority list of transitions
List<String> getStatesPriorityList()
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 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 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 boolean isValid ()

Get property validity

Returns
  • true if valid, false if invalid