Class EmbeddedLeaderService
- java.lang.Object
-
- org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedLeaderService
-
public class EmbeddedLeaderService extends Object
A simple leader election service, which selects a leader among contenders and notifies listeners.An election service for contenders can be created via
#createLeaderElectionService()
, a listener service for leader observers can be created viacreateLeaderRetrievalService()
.
-
-
Constructor Summary
Constructors Constructor Description EmbeddedLeaderService(Executor notificationsDispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LeaderElection
createLeaderElectionService(String componentId)
LeaderRetrievalService
createLeaderRetrievalService()
boolean
isShutdown()
void
shutdown()
Shuts down this leader election service.
-
-
-
Constructor Detail
-
EmbeddedLeaderService
public EmbeddedLeaderService(Executor notificationsDispatcher)
-
-
Method Detail
-
shutdown
public void shutdown()
Shuts down this leader election service.This method does not perform a clean revocation of the leader status and no notification to any leader listeners. It simply notifies all contenders and listeners that the service is no longer available.
-
isShutdown
@VisibleForTesting public boolean isShutdown()
-
createLeaderElectionService
public LeaderElection createLeaderElectionService(String componentId)
-
createLeaderRetrievalService
public LeaderRetrievalService createLeaderRetrievalService()
-
-