public class ManagedLedgerFactoryImpl extends Object implements ManagedLedgerFactory
| Modifier and Type | Class and Description |
|---|---|
static interface |
ManagedLedgerFactoryImpl.BookkeeperFactoryForCustomEnsemblePlacementPolicy
Factory to create Bookkeeper-client for a given ensemblePlacementPolicy
|
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<String,CompletableFuture<ManagedLedgerImpl>> |
ledgers |
protected ManagedLedgerFactoryMBeanImpl |
mbean |
protected ConcurrentHashMap<String,org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.PendingInitializeManagedLedger> |
pendingInitializeLedgers |
protected org.apache.bookkeeper.common.util.OrderedScheduler |
scheduledExecutor |
static int |
StatsPeriodSeconds |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncDelete(String name,
AsyncCallbacks.DeleteLedgerCallback callback,
Object ctx)
Delete a managed ledger.
|
void |
asyncGetManagedLedgerInfo(String name,
AsyncCallbacks.ManagedLedgerInfoCallback callback,
Object ctx)
Asynchronously get the current metadata info for a managed ledger.
|
void |
asyncOpen(String name,
AsyncCallbacks.OpenLedgerCallback callback,
Object ctx)
Asynchronous open method.
|
void |
asyncOpen(String name,
ManagedLedgerConfig config,
AsyncCallbacks.OpenLedgerCallback callback,
Supplier<Boolean> mlOwnershipChecker,
Object ctx)
Asynchronous open method.
|
void |
asyncOpenReadOnlyCursor(String managedLedgerName,
Position startPosition,
ManagedLedgerConfig config,
AsyncCallbacks.OpenReadOnlyCursorCallback callback,
Object ctx)
Open a
ReadOnlyCursor positioned to the earliest entry for the specified managed ledger |
void |
delete(String name)
Delete a managed ledger.
|
BookKeeper |
getBookKeeper() |
ManagedLedgerFactoryMXBean |
getCacheStats() |
ManagedLedgerFactoryConfig |
getConfig() |
EntryCacheManager |
getEntryCacheManager() |
ManagedLedgerInfo |
getManagedLedgerInfo(String name)
Get the current metadata info for a managed ledger.
|
Map<String,ManagedLedgerImpl> |
getManagedLedgers()
Helper for getting stats.
|
MetaStore |
getMetaStore() |
ManagedLedger |
open(String name)
Open a managed ledger.
|
ManagedLedger |
open(String name,
ManagedLedgerConfig config)
Open a managed ledger.
|
ReadOnlyCursor |
openReadOnlyCursor(String managedLedgerName,
Position startPosition,
ManagedLedgerConfig config)
Open a
ReadOnlyCursor positioned to the earliest entry for the specified managed ledger |
void |
shutdown()
Releases all the resources maintained by the ManagedLedgerFactory.
|
protected final org.apache.bookkeeper.common.util.OrderedScheduler scheduledExecutor
protected final ManagedLedgerFactoryMBeanImpl mbean
protected final ConcurrentHashMap<String,CompletableFuture<ManagedLedgerImpl>> ledgers
protected final ConcurrentHashMap<String,org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl.PendingInitializeManagedLedger> pendingInitializeLedgers
public static final int StatsPeriodSeconds
public ManagedLedgerFactoryImpl(org.apache.bookkeeper.conf.ClientConfiguration bkClientConfiguration,
String zkConnection)
throws Exception
Exceptionpublic ManagedLedgerFactoryImpl(org.apache.bookkeeper.conf.ClientConfiguration bkClientConfiguration,
ManagedLedgerFactoryConfig config)
throws Exception
Exceptionpublic ManagedLedgerFactoryImpl(org.apache.bookkeeper.conf.ClientConfiguration clientConfiguration,
String zkConnection,
ManagedLedgerFactoryConfig config)
throws Exception
Exceptionpublic ManagedLedgerFactoryImpl(BookKeeper bookKeeper, ZooKeeper zooKeeper) throws Exception
Exceptionpublic ManagedLedgerFactoryImpl(BookKeeper bookKeeper, ZooKeeper zooKeeper, ManagedLedgerFactoryConfig config) throws Exception
Exceptionpublic ManagedLedgerFactoryImpl(ManagedLedgerFactoryImpl.BookkeeperFactoryForCustomEnsemblePlacementPolicy bookKeeperGroupFactory, ZooKeeper zooKeeper, ManagedLedgerFactoryConfig config) throws Exception
Exceptionpublic ManagedLedgerFactoryImpl(ManagedLedgerFactoryImpl.BookkeeperFactoryForCustomEnsemblePlacementPolicy bookKeeperGroupFactory, ZooKeeper zooKeeper, ManagedLedgerFactoryConfig config, org.apache.bookkeeper.stats.StatsLogger statsLogger) throws Exception
Exceptionpublic Map<String,ManagedLedgerImpl> getManagedLedgers()
public ManagedLedger open(String name) throws InterruptedException, ManagedLedgerException
ManagedLedgerFactoryopen in interface ManagedLedgerFactoryname - the unique name that identifies the managed ledgerManagedLedgerExceptionInterruptedExceptionpublic ManagedLedger open(String name, ManagedLedgerConfig config) throws InterruptedException, ManagedLedgerException
ManagedLedgerFactoryopen in interface ManagedLedgerFactoryname - the unique name that identifies the managed ledgerconfig - managed ledger configurationManagedLedgerExceptionInterruptedExceptionpublic void asyncOpen(String name, AsyncCallbacks.OpenLedgerCallback callback, Object ctx)
ManagedLedgerFactoryasyncOpen in interface ManagedLedgerFactoryname - the unique name that identifies the managed ledgercallback - callback objectctx - opaque contextManagedLedgerFactory.open(String)public void asyncOpen(String name, ManagedLedgerConfig config, AsyncCallbacks.OpenLedgerCallback callback, Supplier<Boolean> mlOwnershipChecker, Object ctx)
ManagedLedgerFactoryasyncOpen in interface ManagedLedgerFactoryname - 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 contextManagedLedgerFactory.open(String, ManagedLedgerConfig)public ReadOnlyCursor openReadOnlyCursor(String managedLedgerName, Position startPosition, ManagedLedgerConfig config) throws InterruptedException, ManagedLedgerException
ManagedLedgerFactoryReadOnlyCursor positioned to the earliest entry for the specified managed ledgeropenReadOnlyCursor in interface ManagedLedgerFactorystartPosition - set the cursor on that particular position. If setting to `PositionImpl.earliest` it will be
positioned on the first available entry.InterruptedExceptionManagedLedgerExceptionpublic void asyncOpenReadOnlyCursor(String managedLedgerName, Position startPosition, ManagedLedgerConfig config, AsyncCallbacks.OpenReadOnlyCursorCallback callback, Object ctx)
ManagedLedgerFactoryReadOnlyCursor positioned to the earliest entry for the specified managed ledgerasyncOpenReadOnlyCursor in interface ManagedLedgerFactorystartPosition - set the cursor on that particular position. If setting to `PositionImpl.earliest` it will be
positioned on the first available entry.public void shutdown()
throws InterruptedException,
ManagedLedgerException
ManagedLedgerFactoryshutdown in interface ManagedLedgerFactoryManagedLedgerExceptionInterruptedExceptionpublic ManagedLedgerInfo getManagedLedgerInfo(String name) throws InterruptedException, ManagedLedgerException
ManagedLedgerFactorygetManagedLedgerInfo in interface ManagedLedgerFactoryname - the unique name that identifies the managed ledgerInterruptedExceptionManagedLedgerExceptionpublic void asyncGetManagedLedgerInfo(String name, AsyncCallbacks.ManagedLedgerInfoCallback callback, Object ctx)
ManagedLedgerFactoryasyncGetManagedLedgerInfo in interface ManagedLedgerFactoryname - the unique name that identifies the managed ledgercallback - callback objectctx - opaque contextpublic void delete(String name) throws InterruptedException, ManagedLedgerException
ManagedLedgerFactorydelete in interface ManagedLedgerFactoryInterruptedExceptionManagedLedgerExceptionpublic void asyncDelete(String name, AsyncCallbacks.DeleteLedgerCallback callback, Object ctx)
ManagedLedgerFactoryasyncDelete in interface ManagedLedgerFactorypublic MetaStore getMetaStore()
public ManagedLedgerFactoryConfig getConfig()
public EntryCacheManager getEntryCacheManager()
public ManagedLedgerFactoryMXBean getCacheStats()
public BookKeeper getBookKeeper()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.