Package org.apache.bookkeeper.meta
Interface LedgerManagerFactory
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
AbstractZkLedgerManagerFactory,FlatLedgerManagerFactory,HierarchicalLedgerManagerFactory,LegacyHierarchicalLedgerManagerFactory,LongHierarchicalLedgerManagerFactory,MSLedgerManagerFactory,NullMetadataBookieDriver.NullLedgerManagerFactory
public interface LedgerManagerFactory extends java.lang.AutoCloseableA factory for creating ledger managers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Uninitialize the factory.voidformat(AbstractConfiguration<?> conf, LayoutManager lm)Format the ledger metadata for LedgerManager.intgetCurrentVersion()Return current factory version.LedgerManagerFactoryinitialize(AbstractConfiguration conf, LayoutManager layoutManager, int factoryVersion)Initialize a factory.LedgerAuditorManagernewLedgerAuditorManager()Return a ledger auditor manager, which is used to coordinate the auto-recovery process.LedgerIdGeneratornewLedgerIdGenerator()Return the ledger id generator, which is used for global unique ledger id generation.LedgerManagernewLedgerManager()return ledger manager for client-side to manage ledger metadata.LedgerUnderreplicationManagernewLedgerUnderreplicationManager()Return a ledger underreplication manager, which is used to mark ledgers as unreplicated, and to retrieve a ledger which is underreplicated so that it can be rereplicated.booleanvalidateAndNukeExistingCluster(AbstractConfiguration<?> conf, LayoutManager lm)This method makes sure there are no unexpected znodes under ledgersRootPath and then it proceeds with ledger metadata formatting and nuking the cluster ZK state info.
-
-
-
Method Detail
-
getCurrentVersion
int getCurrentVersion()
Return current factory version.- Returns:
- current version used by factory.
-
initialize
LedgerManagerFactory initialize(AbstractConfiguration conf, LayoutManager layoutManager, int factoryVersion) throws java.io.IOException
Initialize a factory.- Parameters:
conf- Configuration object used to initialize factorylayoutManager- Layout manager used for initialize ledger manager factoryfactoryVersion- What version used to initialize factory.- Returns:
- ledger manager factory instance
- Throws:
java.io.IOException- when fail to initialize the factory.
-
close
void close() throws java.io.IOExceptionUninitialize the factory.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException- when fail to uninitialize the factory.
-
newLedgerIdGenerator
LedgerIdGenerator newLedgerIdGenerator()
Return the ledger id generator, which is used for global unique ledger id generation.- Returns:
- ledger id generator.
-
newLedgerManager
LedgerManager newLedgerManager()
return ledger manager for client-side to manage ledger metadata.- Returns:
- ledger manager
- See Also:
LedgerManager
-
newLedgerUnderreplicationManager
LedgerUnderreplicationManager newLedgerUnderreplicationManager() throws ReplicationException.UnavailableException, java.lang.InterruptedException, ReplicationException.CompatibilityException
Return a ledger underreplication manager, which is used to mark ledgers as unreplicated, and to retrieve a ledger which is underreplicated so that it can be rereplicated.- Returns:
- ledger underreplication manager
- Throws:
ReplicationException.UnavailableExceptionjava.lang.InterruptedExceptionReplicationException.CompatibilityException- See Also:
LedgerUnderreplicationManager
-
newLedgerAuditorManager
LedgerAuditorManager newLedgerAuditorManager() throws java.io.IOException, java.lang.InterruptedException
Return a ledger auditor manager, which is used to coordinate the auto-recovery process.- Returns:
- ledger auditor manager
- Throws:
java.io.IOExceptionjava.lang.InterruptedException- See Also:
LedgerAuditorManager
-
format
void format(AbstractConfiguration<?> conf, LayoutManager lm) throws java.lang.InterruptedException, org.apache.zookeeper.KeeperException, java.io.IOException
Format the ledger metadata for LedgerManager.- Parameters:
conf- Configuration instancelm- Layout manager- Throws:
java.lang.InterruptedExceptionorg.apache.zookeeper.KeeperExceptionjava.io.IOException
-
validateAndNukeExistingCluster
boolean validateAndNukeExistingCluster(AbstractConfiguration<?> conf, LayoutManager lm) throws java.lang.InterruptedException, org.apache.zookeeper.KeeperException, java.io.IOException
This method makes sure there are no unexpected znodes under ledgersRootPath and then it proceeds with ledger metadata formatting and nuking the cluster ZK state info.- Parameters:
conf- Configuration instancelm- Layout manager- Throws:
java.io.IOExceptionorg.apache.zookeeper.KeeperExceptionjava.lang.InterruptedException
-
-