Class CoordinationServiceImpl
java.lang.Object
org.apache.pulsar.metadata.coordination.impl.CoordinationServiceImpl
- All Implemented Interfaces:
AutoCloseable,CoordinationService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<T> LeaderElection<T>getLeaderElection(Class<T> clazz, String path, Consumer<LeaderElectionState> stateChangesListener) Create a newLeaderElectioncontroller.<T> LockManager<T>getLockManager(Class<T> clazz) <T> LockManager<T>getLockManager(MetadataSerde<T> serde) getNextCounterValue(String path) Increment a counter identified by the specified path and return the current value.
-
Constructor Details
-
CoordinationServiceImpl
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getLockManager
- Specified by:
getLockManagerin interfaceCoordinationService
-
getLockManager
- Specified by:
getLockManagerin interfaceCoordinationService
-
getNextCounterValue
Description copied from interface:CoordinationServiceIncrement a counter identified by the specified path and return the current value. The counter value will be guaranteed to be unique within the context of the path. It will retry whenMetadataStoreExceptionhappened. If the maximum number of retries is reached and still failed, the feature will complete with exceptionMetadataStoreException.- Specified by:
getNextCounterValuein interfaceCoordinationService- Parameters:
path- the path that identifies a particular counter- Returns:
- a future that will track the completion of the operation
-
getLeaderElection
public <T> LeaderElection<T> getLeaderElection(Class<T> clazz, String path, Consumer<LeaderElectionState> stateChangesListener) Description copied from interface:CoordinationServiceCreate a newLeaderElectioncontroller.- Specified by:
getLeaderElectionin interfaceCoordinationService- Parameters:
clazz- the class type to be used for serialization/deserializationpath- the path to use for the leader electionstateChangesListener- a listener that will be passed all the state changes- Returns:
-