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, isClosed, metadataStoreNameFields inherited from interface org.apache.pulsar.metadata.api.MetadataStore
LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionZKMetadataStore(String metadataURL, MetadataStoreConfig metadataStoreConfig, boolean enableSessionWatcher) ZKMetadataStore(ZooKeeper zkc) ZKMetadataStore(ZooKeeper zkc, MetadataStoreConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbatchOperation(List<MetadataOp> ops) voidclose()existsFromStore(String path) longInitialize the metadata store cluster if needed.protected voidreceivedSessionEvent(SessionEvent event) Ensure that the next value read from the local client will be up-to-date with the latest version of the value as it can be seen by all the other clients.Methods inherited from class org.apache.pulsar.metadata.impl.batching.AbstractBatchedMetadataStore
getChildrenFromStore, getMetadataEventSynchronizer, storeDelete, storeGet, storePut, updateMetadataEventSynchronizerMethods inherited from class org.apache.pulsar.metadata.impl.AbstractMetadataStore
accept, alreadyClosedFailedFuture, delete, deleteRecursive, execute, execute, exists, get, getChildren, getMetadataCache, getMetadataCache, getMetadataCache, handleMetadataEvent, invalidateAll, invalidateCaches, isClosed, notifyParentChildrenChanged, parent, put, put, putInternal, receivedNotification, registerListener, registerSessionListener, registerSyncListener, 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, deleteIfExists, deleteRecursive, exists, get, getChildren, getDefaultMetadataCacheConfig, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, put, registerListenerMethods inherited from interface org.apache.pulsar.metadata.api.extended.MetadataStoreExtended
getMetadataEventSynchronizer, handleMetadataEvent, put, registerSessionListener, updateMetadataEventSynchronizer
-
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
-
ZKMetadataStore
-
-
Method Details
-
receivedSessionEvent
- Overrides:
receivedSessionEventin classAbstractMetadataStore
-
sync
Description copied from interface:MetadataStoreEnsure that the next value read from the local client will be up-to-date with the latest version of the value as it can be seen by all the other clients.- Specified by:
syncin interfaceMetadataStore- Returns:
- a handle to the operation
-
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
-
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
-