java.lang.Object | |
↳ | org.apache.helix.controller.GenericHelixController |
Cluster Controllers main goal is to keep the cluster state as close as possible to
Ideal State. It does this by listening to changes in cluster state and scheduling new
tasks to get cluster state to best possible ideal state. Every instance of this class
can control can control only one cluster
Get all the partitions use IdealState, CurrentState and Messages
foreach partition
1. get the (instance,state) from IdealState, CurrentState and PendingMessages
2. compute best possible state (instance,state) pair. This needs previous step data and
state model constraints
3. compute the messages/tasks needed to move to 1 to 2
4. select the messages that can be sent, needs messages and state model constraints
5. send messages
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor that creates a default pipeline registry.
| |||||||||||
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked when participant config changes
| |||||||||||
Invoked when controller changes
| |||||||||||
Invoked when external view changes
| |||||||||||
Invoked when health stats change
| |||||||||||
Invoed when ideal state changes
| |||||||||||
Invoked when live instance changes
| |||||||||||
Invoked when message changes
| |||||||||||
Invoked when current state changes
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Go through the list of liveinstances in the cluster, and add currentstateChange
listener and Message listeners to them if they are newly added.
| |||||||||||
lock-always: caller always needs to obtain an external lock before call, calls to
handleEvent() should be serialized
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Default constructor that creates a default pipeline registry. This is sufficient in most cases, but if there is a some thing specific needed use another constructor where in you can pass a pipeline registry
Invoked when participant config changes
Invoked when controller changes
changeContext | description of the event and state |
---|
Invoked when external view changes
externalViewList | a list of ExternalViews |
---|---|
changeContext | the change event and state |
Invoked when health stats change
instanceName | the instance where the health status changed |
---|---|
reports | the health statuses |
changeContext | event properties and state |
Invoed when ideal state changes
Invoked when live instance changes
Invoked when message changes
Invoked when current state changes
instanceName | name of the instance whose state changed |
---|---|
statesInfo | a list of the current states |
changeContext | the change event and state |
Go through the list of liveinstances in the cluster, and add currentstateChange listener and Message listeners to them if they are newly added. For current state change, the observation is tied to the session id of each live instance.
lock-always: caller always needs to obtain an external lock before call, calls to handleEvent() should be serialized