Package org.apache.bookkeeper.meta.zk
Class ZKMetadataDriverBase
- java.lang.Object
-
- org.apache.bookkeeper.meta.zk.ZKMetadataDriverBase
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
ZKMetadataBookieDriver
,ZKMetadataClientDriver
public class ZKMetadataDriverBase extends java.lang.Object implements java.lang.AutoCloseable
This is a mixin class for supporting zookeeper based metadata driver.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<org.apache.zookeeper.data.ACL>
acls
protected AbstractConfiguration<?>
conf
(package private) java.lang.String
disableHealthCheckPath
protected LayoutManager
layoutManager
protected java.lang.String
ledgersRootPath
protected LedgerManagerFactory
lmFactory
protected boolean
metadataServiceAvailable
protected boolean
ownZKHandle
protected static java.lang.String
SCHEME
protected StatsLogger
statsLogger
protected org.apache.zookeeper.ZooKeeper
zk
-
Constructor Summary
Constructors Constructor Description ZKMetadataDriverBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.util.concurrent.CompletableFuture<java.lang.Void>
disableHealthCheck()
java.util.concurrent.CompletableFuture<java.lang.Void>
enableHealthCheck()
LayoutManager
getLayoutManager()
LedgerManagerFactory
getLedgerManagerFactory()
java.lang.String
getScheme()
org.apache.zookeeper.ZooKeeper
getZk()
static java.lang.String
getZKServersFromServiceUri(java.net.URI uri)
protected void
initialize(AbstractConfiguration<?> conf, StatsLogger statsLogger, RetryPolicy zkRetryPolicy, java.util.Optional<java.lang.Object> optionalCtx)
java.util.concurrent.CompletableFuture<java.lang.Boolean>
isHealthCheckEnabled()
static java.lang.Class<? extends LedgerManagerFactory>
resolveLedgerManagerFactory(java.net.URI metadataServiceUri)
static java.lang.String
resolveZkLedgersRootPath(AbstractConfiguration<?> conf)
static java.lang.String
resolveZkServers(AbstractConfiguration<?> conf)
void
setZk(org.apache.zookeeper.ZooKeeper zk)
-
-
-
Field Detail
-
SCHEME
protected static final java.lang.String SCHEME
- See Also:
- Constant Field Values
-
metadataServiceAvailable
protected volatile boolean metadataServiceAvailable
-
conf
protected AbstractConfiguration<?> conf
-
statsLogger
protected StatsLogger statsLogger
-
acls
protected java.util.List<org.apache.zookeeper.data.ACL> acls
-
zk
protected org.apache.zookeeper.ZooKeeper zk
-
ownZKHandle
protected boolean ownZKHandle
-
disableHealthCheckPath
java.lang.String disableHealthCheckPath
-
ledgersRootPath
protected java.lang.String ledgersRootPath
-
layoutManager
protected LayoutManager layoutManager
-
lmFactory
protected LedgerManagerFactory lmFactory
-
-
Method Detail
-
getZKServersFromServiceUri
public static java.lang.String getZKServersFromServiceUri(java.net.URI uri)
-
resolveZkServers
public static java.lang.String resolveZkServers(AbstractConfiguration<?> conf)
-
resolveZkLedgersRootPath
public static java.lang.String resolveZkLedgersRootPath(AbstractConfiguration<?> conf)
-
resolveLedgerManagerFactory
public static java.lang.Class<? extends LedgerManagerFactory> resolveLedgerManagerFactory(java.net.URI metadataServiceUri)
-
getScheme
public java.lang.String getScheme()
-
initialize
protected void initialize(AbstractConfiguration<?> conf, StatsLogger statsLogger, RetryPolicy zkRetryPolicy, java.util.Optional<java.lang.Object> optionalCtx) throws MetadataException
- Throws:
MetadataException
-
getLayoutManager
public LayoutManager getLayoutManager()
-
getLedgerManagerFactory
public LedgerManagerFactory getLedgerManagerFactory() throws MetadataException
- Throws:
MetadataException
-
disableHealthCheck
public java.util.concurrent.CompletableFuture<java.lang.Void> disableHealthCheck()
-
enableHealthCheck
public java.util.concurrent.CompletableFuture<java.lang.Void> enableHealthCheck()
-
isHealthCheckEnabled
public java.util.concurrent.CompletableFuture<java.lang.Boolean> isHealthCheckEnabled()
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
getZk
public org.apache.zookeeper.ZooKeeper getZk()
-
setZk
public void setZk(org.apache.zookeeper.ZooKeeper zk)
-
-