Module org.elasticsearch.server
Class StoreHeartbeatService
java.lang.Object
org.elasticsearch.cluster.coordination.stateless.StoreHeartbeatService
- All Implemented Interfaces:
LeaderHeartbeatService
-
Field Summary
FieldsModifier and TypeFieldDescriptionHow frequently the master will write a heartbeat to the blob store.Multiplied against HEARTBEAT_FREQUENCY to determine how long to wait for the last master heartbeat to fade before a node can run for election.Fields inherited from interface org.elasticsearch.cluster.coordination.LeaderHeartbeatService
NO_OP -
Constructor Summary
ConstructorsConstructorDescriptionStoreHeartbeatService(HeartbeatStore heartbeatStore, ThreadPool threadPool, TimeValue heartbeatFrequency, TimeValue maxTimeSinceLastHeartbeat, Consumer<ActionListener<OptionalLong>> currentTermSupplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected longstatic StoreHeartbeatServicecreate(HeartbeatStore heartbeatStore, ThreadPool threadPool, Settings settings, Consumer<ActionListener<OptionalLong>> currentTermSupplier) voidstart(DiscoveryNode currentLeader, long term, ActionListener<Long> completionListener) Start a heartbeat process for the given term.voidstop()
-
Field Details
-
HEARTBEAT_FREQUENCY
How frequently the master will write a heartbeat to the blob store. Indicates that the master node is still alive, preventing other nodes from running for election. -
MAX_MISSED_HEARTBEATS
Multiplied against HEARTBEAT_FREQUENCY to determine how long to wait for the last master heartbeat to fade before a node can run for election. Defaults to 2, for a waiting period of 2x the HEARTBEAT_FREQUENCY. Reducing to 1 may get pretty racy with the heartbeat frequency, and isn't advised.
-
-
Constructor Details
-
StoreHeartbeatService
public StoreHeartbeatService(HeartbeatStore heartbeatStore, ThreadPool threadPool, TimeValue heartbeatFrequency, TimeValue maxTimeSinceLastHeartbeat, Consumer<ActionListener<OptionalLong>> currentTermSupplier)
-
-
Method Details
-
create
public static StoreHeartbeatService create(HeartbeatStore heartbeatStore, ThreadPool threadPool, Settings settings, Consumer<ActionListener<OptionalLong>> currentTermSupplier) -
start
Description copied from interface:LeaderHeartbeatServiceStart a heartbeat process for the given term. The listener is notified when the heartbeat process completes, which may happen if it fails to write a heartbeat, or a newer term is discovered.- Specified by:
startin interfaceLeaderHeartbeatService
-
stop
public void stop()- Specified by:
stopin interfaceLeaderHeartbeatService
-
absoluteTimeInMillis
protected long absoluteTimeInMillis()
-