Package org.elasticsearch.cluster
Interface LocalNodeMasterListener
-
- All Known Implementing Classes:
InternalClusterInfoService
public interface LocalNodeMasterListener
Enables listening to master changes events of the local node (when the local node becomes the master, and when the local node cease being a master).
-
-
Method Summary
Modifier and Type Method Description java.lang.String
executorName()
The name of the executor that the implementation of the callbacks of this lister should be executed on.void
offMaster()
Called when the local node used to be the master, a new master was elected and it's no longer the local node.void
onMaster()
Called when local node is elected to be the master
-
-
-
Method Detail
-
onMaster
void onMaster()
Called when local node is elected to be the master
-
offMaster
void offMaster()
Called when the local node used to be the master, a new master was elected and it's no longer the local node.
-
executorName
java.lang.String executorName()
The name of the executor that the implementation of the callbacks of this lister should be executed on. The thread that is responsible for managing instances of this lister is the same thread handling the cluster state events. If the work done is the callbacks above is inexpensive, this value may beSAME
(indicating that the callbacks will run on the same thread as the cluster state events are fired with). On the other hand, if the logic in the callbacks are heavier and take longer to process (or perhaps involve blocking due to IO operations), prefer to execute them on a separate more appropriate executor (eg.GENERIC
orMANAGEMENT
).- Returns:
- The name of the executor that will run the callbacks of this listener.
-
-