Interface MetadataStoreExtended
- All Superinterfaces:
AutoCloseable,MetadataStore
- All Known Implementing Classes:
AbstractBatchedMetadataStore,AbstractMetadataStore,EtcdMetadataStore,FaultInjectionMetadataStore,LocalMemoryMetadataStore,RocksdbMetadataStore,ZKMetadataStore
Extension of the
MetadataStore interface that includes more methods which might not be supported by all
implementations.-
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataStoreExtendedcreate(String metadataURL, MetadataStoreConfig metadataStoreConfig) default Optional<MetadataEventSynchronizer>GetMetadataEventSynchronizerto notify and synchronize metadata events.Put a new value for a given key.voidregisterSessionListener(Consumer<SessionEvent> listener) Register a session listener that will get notified of changes in status of the current session.Methods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface org.apache.pulsar.metadata.api.MetadataStore
delete, deleteRecursive, exists, get, getChildren, getDefaultMetadataCacheConfig, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, put, registerListener
-
Method Details
-
create
static MetadataStoreExtended create(String metadataURL, MetadataStoreConfig metadataStoreConfig) throws MetadataStoreException - Throws:
MetadataStoreException
-
put
CompletableFuture<Stat> put(String path, byte[] value, Optional<Long> expectedVersion, EnumSet<CreateOption> options) Put a new value for a given key. The caller can specify an expected version to be atomically checked against the current version of the stored data. The future will return theStatobject associated with the newly inserted value.- Parameters:
path- the path of the key to delete from the storevalue- the value toexpectedVersion- if present, the version will have to match with the currently stored value for the operation to succeed. Use -1 to enforce a non-existing value.options- a set ofCreateOptionto use if the the key-value pair is being created- Returns:
- a future to track the async request
- Throws:
MetadataStoreException.BadVersionException- if the expected version doesn't match the actual version of the data
-
registerSessionListener
Register a session listener that will get notified of changes in status of the current session.- Parameters:
listener- the session listener
-
getMetadataEventSynchronizer
GetMetadataEventSynchronizerto notify and synchronize metadata events.- Returns:
-