Package org.apache.bookkeeper.discover
Interface RegistrationClient
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ZKRegistrationClient
A registration client, which the bookkeeper client will use to interact with registration service.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceListener to receive changes from the registration service. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get the list of all bookies identifiers.default CompletableFuture<Versioned<BookieServiceInfo>>getBookieServiceInfo(BookieId bookieId) Get detailed information about the services exposed by a Bookie.Get the list of readonly bookie identifiers.Get the list of writable bookie identifiers.voidUnwatch the changes of bookies.voidUnwatch the changes of bookies.Watch the changes of bookies.Watch the changes of bookies.
-
Method Details
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
getWritableBookies
CompletableFuture<Versioned<Set<BookieId>>> getWritableBookies()Get the list of writable bookie identifiers.- Returns:
- a future represents the list of writable bookies.
-
getAllBookies
CompletableFuture<Versioned<Set<BookieId>>> getAllBookies()Get the list of all bookies identifiers.- Returns:
- a future represents the list of all bookies.
-
getReadOnlyBookies
CompletableFuture<Versioned<Set<BookieId>>> getReadOnlyBookies()Get the list of readonly bookie identifiers.- Returns:
- a future represents the list of readonly bookies.
-
getBookieServiceInfo
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
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
Unwatch the changes of bookies.- Parameters:
listener- listener to receive the topology changes of bookies.
-
watchReadOnlyBookies
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
Unwatch the changes of bookies.- Parameters:
listener- listener to receive the topology changes of bookies.
-