java.lang.Object | |
↳ | org.apache.helix.model.StateModelDefinition.Builder |
Construct a state model
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Start building a state model with a id
| |||||||||||
Start building a state model with a name
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the priority to Integer.MAX_VALUE
| |||||||||||
Sets the priority to Integer.MAX_VALUE
| |||||||||||
Define all valid states using this method.
| |||||||||||
Define all valid states using this method.
| |||||||||||
Define all legal transitions between states using this method.
| |||||||||||
Add a state transition with maximal priority value
| |||||||||||
Add a state transition with maximal priority value
| |||||||||||
Define all legal transitions between states using this method.
| |||||||||||
Create a StateModelDefinition from this Builder
| |||||||||||
You can use this to have the bounds dynamically change based on other
parameters.
| |||||||||||
You can use this to have the bounds dynamically change based on other
parameters.
| |||||||||||
initial state of a replica when it starts, most commonly used initial
state is OFFLINE
| |||||||||||
initial state of a replica when it starts, most commonly used initial
state is OFFLINE
| |||||||||||
Set a maximum for replicas in this state
| |||||||||||
Set a maximum for replicas in this state
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Start building a state model with a id
stateModelDefId | state model id |
---|
Start building a state model with a name
Define all valid states using this method. Set the priority in which the
constraints must be satisfied. Lets say STATE1 has a constraint of 1 and
STATE2 has a constraint of 3 but only one node is up then Helix will uses
the priority to see STATE constraint has to be given higher preference
Use -1 to indicates states with no constraints, like OFFLINE
state | the state to add |
---|---|
priority | the state priority, lower number is higher priority |
Define all valid states using this method. Set the priority in which the
constraints must be satisfied. Lets say STATE1 has a constraint of 1 and
STATE2 has a constraint of 3 but only one node is up then Helix will uses
the priority to see STATE constraint has to be given higher preference
Use -1 to indicates states with no constraints, like OFFLINE
state | the state to add |
---|---|
priority | the state priority, lower number is higher priority |
Define all legal transitions between states using this method. Priority is used to order the transitions. Helix tries to maximize the number of transitions that can be fired in parallel without violating the constraint. The transitions are first sorted based on priority and transitions are selected in a greedy way until the constriants are not violated.
fromState | source |
---|---|
toState | destination |
priority | priority, higher value is higher priority |
Add a state transition with maximal priority value
Add a state transition with maximal priority value
Define all legal transitions between states using this method. Priority is used to order the transitions. Helix tries to maximize the number of transitions that can be fired in parallel without violating the constraint. The transitions are first sorted based on priority and transitions are selected in a greedy way until the constriants are not violated.
fromState | source |
---|---|
toState | destination |
priority | priority, higher value is higher priority |
Create a StateModelDefinition from this Builder
You can use this to have the bounds dynamically change based on other
parameters.
Currently support 2 values
R --> Refers to the number of replicas specified during resource
creation. This allows having different replication factor for each
resource without having to create a different state machine.
N --> Refers to all nodes in the cluster. Useful for resources that need
to exist on all nodes. This way one can add/remove nodes without having
the change the bounds.
You can use this to have the bounds dynamically change based on other
parameters.
Currently support 2 values
R --> Refers to the number of replicas specified during resource
creation. This allows having different replication factor for each
resource without having to create a different state machine.
N --> Refers to all nodes in the cluster. Useful for resources that need
to exist on all nodes. This way one can add/remove nodes without having
the change the bounds.
initial state of a replica when it starts, most commonly used initial state is OFFLINE
initial state of a replica when it starts, most commonly used initial state is OFFLINE
Set a maximum for replicas in this state
state | state name |
---|---|
upperBound | maximum |
Set a maximum for replicas in this state
state | state name |
---|---|
upperBound | maximum |