Class CoordinationServiceImpl

    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
      • getNextCounterValue

        public java.util.concurrent.CompletableFuture<java.lang.Long> getNextCounterValue​(java.lang.String path)
        Description copied from interface: CoordinationService
        Increment 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 when MetadataStoreException happened. If the maximum number of retries is reached and still failed, the feature will complete with exception MetadataStoreException.
        Specified by:
        getNextCounterValue in interface CoordinationService
        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​(java.lang.Class<T> clazz,
                                                       java.lang.String path,
                                                       java.util.function.Consumer<LeaderElectionState> stateChangesListener)
        Description copied from interface: CoordinationService
        Create a new LeaderElection controller.
        Specified by:
        getLeaderElection in interface CoordinationService
        Parameters:
        clazz - the class type to be used for serialization/deserialization
        path - the path to use for the leader election
        stateChangesListener - a listener that will be passed all the state changes
        Returns: