Package org.apache.bookkeeper.discover
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RegistrationClient.RegistrationListener
Listener to receive changes from the registration service.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
java.util.concurrent.CompletableFuture<Versioned<java.util.Set<BookieId>>>
getAllBookies()
Get the list of all bookies identifiers.default java.util.concurrent.CompletableFuture<Versioned<BookieServiceInfo>>
getBookieServiceInfo(BookieId bookieId)
Get detailed information about the services exposed by a Bookie.java.util.concurrent.CompletableFuture<Versioned<java.util.Set<BookieId>>>
getReadOnlyBookies()
Get the list of readonly bookie identifiers.java.util.concurrent.CompletableFuture<Versioned<java.util.Set<BookieId>>>
getWritableBookies()
Get the list of writable bookie identifiers.void
unwatchReadOnlyBookies(RegistrationClient.RegistrationListener listener)
Unwatch the changes of bookies.void
unwatchWritableBookies(RegistrationClient.RegistrationListener listener)
Unwatch the changes of bookies.java.util.concurrent.CompletableFuture<java.lang.Void>
watchReadOnlyBookies(RegistrationClient.RegistrationListener listener)
Watch the changes of bookies.java.util.concurrent.CompletableFuture<java.lang.Void>
watchWritableBookies(RegistrationClient.RegistrationListener listener)
Watch the changes of bookies.
-
-
-
Method Detail
-
close
void close()
- Specified by:
close
in interfacejava.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 aBookieId
- 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.
-
-