Interface MetadataStoreExtended
-
- All Superinterfaces:
java.lang.AutoCloseable,MetadataStore
- All Known Implementing Classes:
AbstractBatchedMetadataStore,AbstractMetadataStore,EtcdMetadataStore,FaultInjectionMetadataStore,LocalMemoryMetadataStore,RocksdbMetadataStore,ZKMetadataStore
public interface MetadataStoreExtended extends MetadataStore
Extension of theMetadataStoreinterface that includes more methods which might not be supported by all implementations.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static MetadataStoreExtendedcreate(java.lang.String metadataURL, MetadataStoreConfig metadataStoreConfig)java.util.concurrent.CompletableFuture<Stat>put(java.lang.String path, byte[] value, java.util.Optional<java.lang.Long> expectedVersion, java.util.EnumSet<CreateOption> options)Put a new value for a given key.voidregisterSessionListener(java.util.function.Consumer<SessionEvent> listener)Register a session listener that will get notified of changes in status of the current session.-
Methods inherited from interface org.apache.pulsar.metadata.api.MetadataStore
delete, deleteRecursive, exists, get, getChildren, getDefaultMetadataCacheConfig, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, getMetadataCache, put, registerListener
-
-
-
-
Method Detail
-
create
static MetadataStoreExtended create(java.lang.String metadataURL, MetadataStoreConfig metadataStoreConfig) throws MetadataStoreException
- Throws:
MetadataStoreException
-
put
java.util.concurrent.CompletableFuture<Stat> put(java.lang.String path, byte[] value, java.util.Optional<java.lang.Long> expectedVersion, java.util.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
void registerSessionListener(java.util.function.Consumer<SessionEvent> listener)
Register a session listener that will get notified of changes in status of the current session.- Parameters:
listener- the session listener
-
-