java.lang.Object | |
↳ | org.apache.helix.participant.HelixCustomCodeRunner |
This provides the ability for users to run a custom code in exactly one
process using a LeaderStandBy state model.
A typical use case is when one uses CUSTOMIZED ideal state mode where the
assignment of partition to nodes needs to change dynamically as the nodes go
online/offline.
HelixCustomCodeRunner runner = new HelixCustomCodeRunner(manager,ZK_ADDR);
runner
.invoke(_callback)
.on(ChangeType.LIVE_INSTANCE, ChangeType.IdealState)
.usingLeaderStandbyModel("someUniqueId")
.run()
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a HelixCustomCodeRunner that will run exactly in one place
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
callback to invoke when there is a change in cluster state specified by on(
notificationTypes) This callback must be idempotent which means they should
not depend on what changed instead simply read the cluster data and act on
it.
| |||||||||||
ChangeTypes interested in, ParticipantLeaderCallback.callback method will
be invoked on the
| |||||||||||
This method will be invoked when there is a change in any subscribed
notificationTypes
| |||||||||||
Stop customer code runner
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a HelixCustomCodeRunner that will run exactly in one place
callback to invoke when there is a change in cluster state specified by on( notificationTypes) This callback must be idempotent which means they should not depend on what changed instead simply read the cluster data and act on it.
ChangeTypes interested in, ParticipantLeaderCallback.callback method will be invoked on the
This method will be invoked when there is a change in any subscribed notificationTypes
Exception |
---|
Stop customer code runner