Package org.apache.bookkeeper.meta
Interface MetadataClientDriver
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
ZKMetadataClientDriver
@LimitedPrivate @Evolving public interface MetadataClientDriver extends java.lang.AutoCloseable
Driver to manage all the metadata managers required by a bookkeeper client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MetadataClientDriver.SessionStateListener
State Listener on listening the metadata client session states.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
LayoutManager
getLayoutManager()
Return the layout manager.LedgerManagerFactory
getLedgerManagerFactory()
Return the ledger manager factory used for accessing ledger metadata.RegistrationClient
getRegistrationClient()
Return the registration client used for discovering registered bookies.java.lang.String
getScheme()
Get the scheme of the metadata driver.MetadataClientDriver
initialize(ClientConfiguration conf, java.util.concurrent.ScheduledExecutorService scheduler, StatsLogger statsLogger, java.util.Optional<java.lang.Object> ctx)
Initialize the metadata driver.default java.util.concurrent.CompletableFuture<java.lang.Boolean>
isHealthCheckEnabled()
Return health check is enable or disable.default java.util.concurrent.CompletableFuture<java.lang.Boolean>
isMetadataServiceAvailable()
Return driver metadata service is available.void
setSessionStateListener(MetadataClientDriver.SessionStateListener sessionStateListener)
sets session state listener.
-
-
-
Method Detail
-
initialize
MetadataClientDriver initialize(ClientConfiguration conf, java.util.concurrent.ScheduledExecutorService scheduler, StatsLogger statsLogger, java.util.Optional<java.lang.Object> ctx) throws MetadataException
Initialize the metadata driver.- Parameters:
conf
- configurationscheduler
- schedulerstatsLogger
- stats loggerctx
- optional context object passed in for initialization. currently it is an external zookeeper instance, which can be used for zookeeper based metadata implementation.- Returns:
- metadata driver
- Throws:
MetadataException
- when fail to initialize the client driver.
-
getScheme
java.lang.String getScheme()
Get the scheme of the metadata driver.- Returns:
- the scheme of the metadata driver.
-
getRegistrationClient
RegistrationClient getRegistrationClient()
Return the registration client used for discovering registered bookies.- Returns:
- the registration client used for discovering registered bookies.
-
getLedgerManagerFactory
LedgerManagerFactory getLedgerManagerFactory() throws MetadataException
Return the ledger manager factory used for accessing ledger metadata.- Returns:
- the ledger manager factory used for accessing ledger metadata.
- Throws:
MetadataException
-
getLayoutManager
LayoutManager getLayoutManager()
Return the layout manager.- Returns:
- the layout manager.
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
setSessionStateListener
void setSessionStateListener(MetadataClientDriver.SessionStateListener sessionStateListener)
sets session state listener.- Parameters:
sessionStateListener
- listener listening on metadata client session states.
-
isHealthCheckEnabled
default java.util.concurrent.CompletableFuture<java.lang.Boolean> isHealthCheckEnabled()
Return health check is enable or disable.- Returns:
- true if health check is enable, otherwise false.
-
isMetadataServiceAvailable
default java.util.concurrent.CompletableFuture<java.lang.Boolean> isMetadataServiceAvailable()
Return driver metadata service is available.- Returns:
- the metadata service is available.
-
-