Class LeaderElectionService
java.lang.Object
org.apache.pulsar.broker.loadbalance.LeaderElectionService
- All Implemented Interfaces:
AutoCloseable
A class that provides way to elect the leader among brokers.
-
Constructor Summary
ConstructorsConstructorDescriptionLeaderElectionService(org.apache.pulsar.metadata.api.coordination.CoordinationService cs, String localWebServiceAddress, Consumer<org.apache.pulsar.metadata.api.coordination.LeaderElectionState> listener) -
Method Summary
-
Constructor Details
-
LeaderElectionService
-
-
Method Details
-
start
public void start() -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
readCurrentLeader
-
getCurrentLeader
-
isLeader
public boolean isLeader()
-