Package org.apache.bookkeeper.meta
Class AbstractZkLedgerManagerFactory
- java.lang.Object
-
- org.apache.bookkeeper.meta.AbstractZkLedgerManagerFactory
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,LedgerManagerFactory
- Direct Known Subclasses:
FlatLedgerManagerFactory
,LegacyHierarchicalLedgerManagerFactory
,MSLedgerManagerFactory
public abstract class AbstractZkLedgerManagerFactory extends java.lang.Object implements LedgerManagerFactory
Abstract ledger manager factory based on zookeeper, which provides common methods such as format and validateAndNukeExistingCluster.
-
-
Constructor Summary
Constructors Constructor Description AbstractZkLedgerManagerFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static LedgerManagerFactory
createNewLMFactory(AbstractConfiguration conf, LayoutManager layoutManager, java.lang.Class<? extends LedgerManagerFactory> factoryClass)
Creates the new layout and stores in zookeeper and returns the LedgerManagerFactory instance.void
format(AbstractConfiguration<?> conf, LayoutManager layoutManager)
Format the ledger metadata for LedgerManager.static LedgerManagerFactory
newLedgerManagerFactory(AbstractConfiguration<?> conf, LayoutManager layoutManager)
Create new Ledger Manager Factory.boolean
validateAndNukeExistingCluster(AbstractConfiguration<?> conf, LayoutManager layoutManager)
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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.bookkeeper.meta.LedgerManagerFactory
close, getCurrentVersion, initialize, newLedgerAuditorManager, newLedgerIdGenerator, newLedgerManager, newLedgerUnderreplicationManager
-
-
-
-
Field Detail
-
zk
protected org.apache.zookeeper.ZooKeeper zk
-
V1
static final int V1
- See Also:
- Constant Field Values
-
-
Method Detail
-
format
public void format(AbstractConfiguration<?> conf, LayoutManager layoutManager) throws java.lang.InterruptedException, org.apache.zookeeper.KeeperException, java.io.IOException
Description copied from interface:LedgerManagerFactory
Format the ledger metadata for LedgerManager.- Specified by:
format
in interfaceLedgerManagerFactory
- Parameters:
conf
- Configuration instancelayoutManager
- Layout manager- Throws:
java.lang.InterruptedException
org.apache.zookeeper.KeeperException
java.io.IOException
-
validateAndNukeExistingCluster
public boolean validateAndNukeExistingCluster(AbstractConfiguration<?> conf, LayoutManager layoutManager) throws java.lang.InterruptedException, org.apache.zookeeper.KeeperException, java.io.IOException
Description copied from interface:LedgerManagerFactory
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.- Specified by:
validateAndNukeExistingCluster
in interfaceLedgerManagerFactory
- Parameters:
conf
- Configuration instancelayoutManager
- Layout manager- Throws:
java.lang.InterruptedException
org.apache.zookeeper.KeeperException
java.io.IOException
-
newLedgerManagerFactory
public static LedgerManagerFactory newLedgerManagerFactory(AbstractConfiguration<?> conf, LayoutManager layoutManager) throws java.io.IOException, java.lang.InterruptedException
Create new Ledger Manager Factory.- Parameters:
conf
- Configuration Object.layoutManager
- layout manager- Returns:
- new ledger manager factory
- Throws:
java.io.IOException
java.lang.InterruptedException
-
createNewLMFactory
protected static LedgerManagerFactory createNewLMFactory(AbstractConfiguration conf, LayoutManager layoutManager, java.lang.Class<? extends LedgerManagerFactory> factoryClass) throws java.io.IOException, java.lang.InterruptedException
Creates the new layout and stores in zookeeper and returns the LedgerManagerFactory instance.- Throws:
java.io.IOException
java.lang.InterruptedException
-
-