Interface MetaStore
- All Known Implementing Classes:
MetaStoreImpl
public interface MetaStore
Interface that describes the operations that the ManagedLedger need to do on the metadata store.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionasyncExists(String ledgerName) Check ledger exists.voidasyncGetCursorInfo(String ledgerName, String cursorName, MetaStore.MetaStoreCallback<MLDataFormats.ManagedCursorInfo> callback) Get the ledger id associated with a cursor.voidasyncRemoveCursor(String ledgerName, String cursorName, MetaStore.MetaStoreCallback<Void> callback) Drop the persistent state of a consumer from the metadata store.voidasyncUpdateCursorInfo(String ledgerName, String cursorName, MLDataFormats.ManagedCursorInfo info, Stat stat, MetaStore.MetaStoreCallback<Void> callback) Update the persisted position of a cursor.voidasyncUpdateLedgerIds(String ledgerName, MLDataFormats.ManagedLedgerInfo mlInfo, Stat stat, MetaStore.MetaStoreCallback<Void> callback) voidgetCursors(String ledgerName, MetaStore.MetaStoreCallback<List<String>> callback) Get the list of cursors registered on a ManagedLedger.voidgetManagedLedgerInfo(String ledgerName, boolean createIfMissing, Map<String, String> properties, MetaStore.MetaStoreCallback<MLDataFormats.ManagedLedgerInfo> callback) Get the metadata used by the ManagedLedger.default voidgetManagedLedgerInfo(String ledgerName, boolean createIfMissing, MetaStore.MetaStoreCallback<MLDataFormats.ManagedLedgerInfo> callback) Get the metadata used by the ManagedLedger.Get managed ledger properties from meta store.Get a list of all the managed ledgers in the system.voidremoveManagedLedger(String ledgerName, MetaStore.MetaStoreCallback<Void> callback) Drop the persistent state for the ManagedLedger and all its associated consumers.voidunwatchManagedLedgerInfo(String ledgerName) Unwatch the metadata changes for ledgerName.voidwatchManagedLedgerInfo(String ledgerName, MetaStore.UpdateCallback<MLDataFormats.ManagedLedgerInfo> callback) Watch the metadata used by the ManagedLedger.
-
Method Details
-
getManagedLedgerInfo
default void getManagedLedgerInfo(String ledgerName, boolean createIfMissing, MetaStore.MetaStoreCallback<MLDataFormats.ManagedLedgerInfo> callback) Get the metadata used by the ManagedLedger.- Parameters:
ledgerName- the name of the ManagedLedgercreateIfMissing- whether the managed ledger metadata should be created if it doesn't exist already- Throws:
ManagedLedgerException.MetaStoreException
-
getManagedLedgerInfo
void getManagedLedgerInfo(String ledgerName, boolean createIfMissing, Map<String, String> properties, MetaStore.MetaStoreCallback<MLDataFormats.ManagedLedgerInfo> callback) Get the metadata used by the ManagedLedger.- Parameters:
ledgerName- the name of the ManagedLedgercreateIfMissing- whether the managed ledger metadata should be created if it doesn't exist alreadyproperties- ledger properties- Throws:
ManagedLedgerException.MetaStoreException
-
watchManagedLedgerInfo
void watchManagedLedgerInfo(String ledgerName, MetaStore.UpdateCallback<MLDataFormats.ManagedLedgerInfo> callback) Watch the metadata used by the ManagedLedger.- Parameters:
ledgerName-callback-
-
unwatchManagedLedgerInfo
Unwatch the metadata changes for ledgerName.- Parameters:
ledgerName-
-
asyncUpdateLedgerIds
void asyncUpdateLedgerIds(String ledgerName, MLDataFormats.ManagedLedgerInfo mlInfo, Stat stat, MetaStore.MetaStoreCallback<Void> callback) - Parameters:
ledgerName- the name of the ManagedLedgermlInfo- managed ledger infostat- version object associated with current statecallback- callback object
-
getCursors
Get the list of cursors registered on a ManagedLedger.- Parameters:
ledgerName- the name of the ManagedLedger
-
asyncGetCursorInfo
void asyncGetCursorInfo(String ledgerName, String cursorName, MetaStore.MetaStoreCallback<MLDataFormats.ManagedCursorInfo> callback) Get the ledger id associated with a cursor. This ledger id will contains the mark-deleted position for the cursor.- Parameters:
ledgerName-cursorName-callback-
-
asyncUpdateCursorInfo
void asyncUpdateCursorInfo(String ledgerName, String cursorName, MLDataFormats.ManagedCursorInfo info, Stat stat, MetaStore.MetaStoreCallback<Void> callback) Update the persisted position of a cursor.- Parameters:
ledgerName- the name of the ManagedLedgercursorName-info-stat-callback- the callback- Throws:
ManagedLedgerException.MetaStoreException
-
asyncRemoveCursor
void asyncRemoveCursor(String ledgerName, String cursorName, MetaStore.MetaStoreCallback<Void> callback) Drop the persistent state of a consumer from the metadata store.- Parameters:
ledgerName- the name of the ManagedLedgercursorName- the cursor namecallback- callback object
-
removeManagedLedger
Drop the persistent state for the ManagedLedger and all its associated consumers.- Parameters:
ledgerName- the name of the ManagedLedgercallback- callback object
-
getManagedLedgers
Get a list of all the managed ledgers in the system.- Returns:
- an Iterable of the names of the managed ledgers
- Throws:
ManagedLedgerException.MetaStoreException
-
asyncExists
Check ledger exists. -
getManagedLedgerPropertiesAsync
Get managed ledger properties from meta store.- Parameters:
name- ledgerName- Returns:
- a future represents the result of the operation.
-