Package org.apache.pulsar.metadata.impl
Class ZKMetadataStore
java.lang.Object
org.apache.pulsar.metadata.impl.AbstractMetadataStore
org.apache.pulsar.metadata.impl.batching.AbstractBatchedMetadataStore
org.apache.pulsar.metadata.impl.ZKMetadataStore
- All Implemented Interfaces:
AutoCloseable,Consumer<Notification>,MetadataStoreExtended,MetadataStore,MetadataStoreLifecycle
public class ZKMetadataStore
extends AbstractBatchedMetadataStore
implements MetadataStoreExtended, MetadataStoreLifecycle
-
Field Summary
FieldsFields inherited from class org.apache.pulsar.metadata.impl.AbstractMetadataStore
executor -
Constructor Summary
ConstructorsConstructorDescriptionZKMetadataStore(String metadataURL, MetadataStoreConfig metadataStoreConfig, boolean enableSessionWatcher) ZKMetadataStore(org.apache.zookeeper.ZooKeeper zkc) ZKMetadataStore(org.apache.zookeeper.ZooKeeper zkc, MetadataStoreConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbatchOperation(List<MetadataOp> ops) voidclose()existsFromStore(String path) org.apache.zookeeper.ZooKeeperlongInitialize the metadata store cluster if needed.protected voidreceivedSessionEvent(SessionEvent event) Methods inherited from class org.apache.pulsar.metadata.impl.batching.AbstractBatchedMetadataStore
getChildrenFromStore, getMetadataEventSynchronizer, storeDelete, storeGet, storePutMethods inherited from class org.apache.pulsar.metadata.impl.AbstractMetadataStore
accept, delete, deleteRecursive, execute, exists, get, getChildren, getMetadataCache, getMetadataCache, getMetadataCache, invalidateAll, notifyParentChildrenChanged, parent, put, put, putInternal, receivedNotification, registerListener, registerSessionListener, registerSyncLister, shouldIgnoreEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.metadata.api.MetadataStore
delete, deleteRecursive, exists, get, getChildren, getDefaultMetadataCacheConfig, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, put, registerListenerMethods inherited from interface org.apache.pulsar.metadata.api.extended.MetadataStoreExtended
getMetadataEventSynchronizer, put, registerSessionListener
-
Field Details
-
ZK_SCHEME
- See Also:
-
ZK_SCHEME_IDENTIFIER
- See Also:
-
-
Constructor Details
-
ZKMetadataStore
public ZKMetadataStore(String metadataURL, MetadataStoreConfig metadataStoreConfig, boolean enableSessionWatcher) throws MetadataStoreException - Throws:
MetadataStoreException
-
ZKMetadataStore
public ZKMetadataStore(org.apache.zookeeper.ZooKeeper zkc) -
ZKMetadataStore
-
-
Method Details
-
receivedSessionEvent
- Overrides:
receivedSessionEventin classAbstractMetadataStore
-
batchOperation
- Specified by:
batchOperationin classAbstractBatchedMetadataStore
-
existsFromStore
- Specified by:
existsFromStorein classAbstractMetadataStore
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractBatchedMetadataStore- Throws:
Exception
-
getZkSessionId
public long getZkSessionId() -
getZkClient
public org.apache.zookeeper.ZooKeeper getZkClient() -
initializeCluster
Description copied from interface:MetadataStoreLifecycleInitialize the metadata store cluster if needed. For example, if the backend metadata store is a zookeeper cluster and the pulsar cluster is configured to access the zookeeper cluster in the chroot mode, then this method could be used to initialize the root node during pulsar cluster metadata setup.- Specified by:
initializeClusterin interfaceMetadataStoreLifecycle- Returns:
- a future to track the async request.
-
getRootPath
-