Parameters

Public Methods

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

Returns

See Also

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.

Parameters

fromState

source

toState

destination

priority

priority, higher value is higher priority

Returns

Returns

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.