接口 ManagedLedgerFactory
- 所有已知实现类:
ManagedLedgerFactoryImpl
@LimitedPrivate
@Stable
public interface ManagedLedgerFactory
A factory to open/create managed ledgers and delete them.
-
方法概要
修饰符和类型方法说明voidasyncDelete(String name, AsyncCallbacks.DeleteLedgerCallback callback, Object ctx) Delete a managed ledger.asyncExists(String ledgerName) Check managed ledger has been initialized before.voidasyncGetManagedLedgerInfo(String name, AsyncCallbacks.ManagedLedgerInfoCallback callback, Object ctx) Asynchronously get the current metadata info for a managed ledger.voidasyncOpen(String name, AsyncCallbacks.OpenLedgerCallback callback, Object ctx) Asynchronous open method.voidasyncOpen(String name, ManagedLedgerConfig config, AsyncCallbacks.OpenLedgerCallback callback, Supplier<Boolean> mlOwnershipChecker, Object ctx) Asynchronous open method.voidasyncOpenReadOnlyCursor(String managedLedgerName, Position startPosition, ManagedLedgerConfig config, AsyncCallbacks.OpenReadOnlyCursorCallback callback, Object ctx) Open aReadOnlyCursorpositioned to the earliest entry for the specified managed ledger.voidDelete a managed ledger.longgetManagedLedgerInfo(String name) Get the current metadata info for a managed ledger.Open a managed ledger.open(String name, ManagedLedgerConfig config) Open a managed ledger.openReadOnlyCursor(String managedLedgerName, Position startPosition, ManagedLedgerConfig config) Open aReadOnlyCursorpositioned to the earliest entry for the specified managed ledger.voidshutdown()Releases all the resources maintained by the ManagedLedgerFactory.This method tries it's best to releases all the resources maintained by the ManagedLedgerFactory.voidupdateCacheEvictionTimeThreshold(long cacheEvictionTimeThresholdNanos) update cache evictionTimeThreshold.
-
方法详细资料
-
open
Open a managed ledger. If the managed ledger does not exist, a new one will be automatically created. Uses the default configuration parameters.- 参数:
name- the unique name that identifies the managed ledger- 返回:
- the managed ledger
- 抛出:
ManagedLedgerExceptionInterruptedException
-
open
ManagedLedger open(String name, ManagedLedgerConfig config) throws InterruptedException, ManagedLedgerException Open a managed ledger. If the managed ledger does not exist, a new one will be automatically created.- 参数:
name- the unique name that identifies the managed ledgerconfig- managed ledger configuration- 返回:
- the managed ledger
- 抛出:
ManagedLedgerExceptionInterruptedException
-
asyncOpen
Asynchronous open method.- 参数:
name- the unique name that identifies the managed ledgercallback- callback objectctx- opaque context- 另请参阅:
-
asyncOpen
void asyncOpen(String name, ManagedLedgerConfig config, AsyncCallbacks.OpenLedgerCallback callback, Supplier<Boolean> mlOwnershipChecker, Object ctx) Asynchronous open method.- 参数:
name- the unique name that identifies the managed ledgerconfig- managed ledger configurationcallback- callback objectmlOwnershipChecker- checks ml-ownership in case updating ml-metadata fails due to ownership conflictctx- opaque context- 另请参阅:
-
openReadOnlyCursor
ReadOnlyCursor openReadOnlyCursor(String managedLedgerName, Position startPosition, ManagedLedgerConfig config) throws InterruptedException, ManagedLedgerException Open aReadOnlyCursorpositioned to the earliest entry for the specified managed ledger.- 参数:
managedLedgerName-startPosition- set the cursor on that particular position. If setting to `PositionImpl.earliest` it will be positioned on the first available entry.- 返回:
- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncOpenReadOnlyCursor
void asyncOpenReadOnlyCursor(String managedLedgerName, Position startPosition, ManagedLedgerConfig config, AsyncCallbacks.OpenReadOnlyCursorCallback callback, Object ctx) Open aReadOnlyCursorpositioned to the earliest entry for the specified managed ledger.- 参数:
managedLedgerName-startPosition- set the cursor on that particular position. If setting to `PositionImpl.earliest` it will be positioned on the first available entry.callback-ctx-
-
getManagedLedgerInfo
ManagedLedgerInfo getManagedLedgerInfo(String name) throws InterruptedException, ManagedLedgerException Get the current metadata info for a managed ledger.- 参数:
name- the unique name that identifies the managed ledger- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncGetManagedLedgerInfo
void asyncGetManagedLedgerInfo(String name, AsyncCallbacks.ManagedLedgerInfoCallback callback, Object ctx) Asynchronously get the current metadata info for a managed ledger.- 参数:
name- the unique name that identifies the managed ledgercallback- callback objectctx- opaque context
-
delete
Delete a managed ledger. If it's not open, it's metadata will get regardless deleted.- 参数:
name-- 抛出:
InterruptedExceptionManagedLedgerException
-
asyncDelete
Delete a managed ledger. If it's not open, it's metadata will get regardless deleted.- 参数:
name-- 抛出:
InterruptedExceptionManagedLedgerException
-
shutdown
Releases all the resources maintained by the ManagedLedgerFactory. -
shutdownAsync
This method tries it's best to releases all the resources maintained by the ManagedLedgerFactory. It will take longer time to shutdown than shutdown(); -
asyncExists
Check managed ledger has been initialized before. -
getEntryCacheManager
EntryCacheManager getEntryCacheManager()- 返回:
- return EntryCacheManager.
-
updateCacheEvictionTimeThreshold
void updateCacheEvictionTimeThreshold(long cacheEvictionTimeThresholdNanos) update cache evictionTimeThreshold.- 参数:
cacheEvictionTimeThresholdNanos- time threshold for eviction.
-
getCacheEvictionTimeThreshold
long getCacheEvictionTimeThreshold()- 返回:
- time threshold for eviction.
-