Interface RegistrationClient

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    ZKRegistrationClient

    @LimitedPrivate
    @Evolving
    public interface RegistrationClient
    extends java.lang.AutoCloseable
    A registration client, which the bookkeeper client will use to interact with registration service.
    • Method Detail

      • close

        void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getWritableBookies

        java.util.concurrent.CompletableFuture<Versioned<java.util.Set<BookieId>>> getWritableBookies()
        Get the list of writable bookie identifiers.
        Returns:
        a future represents the list of writable bookies.
      • getAllBookies

        java.util.concurrent.CompletableFuture<Versioned<java.util.Set<BookieId>>> getAllBookies()
        Get the list of all bookies identifiers.
        Returns:
        a future represents the list of all bookies.
      • getReadOnlyBookies

        java.util.concurrent.CompletableFuture<Versioned<java.util.Set<BookieId>>> getReadOnlyBookies()
        Get the list of readonly bookie identifiers.
        Returns:
        a future represents the list of readonly bookies.
      • getBookieServiceInfo

        default java.util.concurrent.CompletableFuture<Versioned<BookieServiceInfo>> getBookieServiceInfo​(BookieId bookieId)
        Get detailed information about the services exposed by a Bookie. For old bookies it is expected to return an empty BookieServiceInfo structure.
        Parameters:
        bookieId - this is the id of the bookie, it can be computed from a BookieId
        Returns:
        a future represents the available information.
        Since:
        4.11
      • watchWritableBookies

        java.util.concurrent.CompletableFuture<java.lang.Void> watchWritableBookies​(RegistrationClient.RegistrationListener listener)
        Watch the changes of bookies.

        The topology changes of bookies will be propagated to the provided listener.

        Parameters:
        listener - listener to receive the topology changes of bookies.
        Returns:
        a future which completes when the bookies have been read for the first time
      • unwatchWritableBookies

        void unwatchWritableBookies​(RegistrationClient.RegistrationListener listener)
        Unwatch the changes of bookies.
        Parameters:
        listener - listener to receive the topology changes of bookies.
      • watchReadOnlyBookies

        java.util.concurrent.CompletableFuture<java.lang.Void> watchReadOnlyBookies​(RegistrationClient.RegistrationListener listener)
        Watch the changes of bookies.

        The topology changes of bookies will be propagated to the provided listener.

        Parameters:
        listener - listener to receive the topology changes of bookies.
        Returns:
        a future which completes when the bookies have been read for the first time
      • unwatchReadOnlyBookies

        void unwatchReadOnlyBookies​(RegistrationClient.RegistrationListener listener)
        Unwatch the changes of bookies.
        Parameters:
        listener - listener to receive the topology changes of bookies.