Package org.apache.bookkeeper.util
Class LocalBookKeeper
java.lang.Object
org.apache.bookkeeper.util.LocalBookKeeper
- All Implemented Interfaces:
AutoCloseable
Local Bookkeeper.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ByteBufAllocatorWithOomHandlerstatic final int(package private) String(package private) List<org.apache.bookkeeper.util.LocalBookKeeper.LocalBookie>(package private) Fileprotected static final org.slf4j.Logger(package private) int(package private) boolean(package private) String(package private) int(package private) ZooKeeperServerShim -
Constructor Summary
ConstructorsConstructorDescriptionLocalBookKeeper(int numberOfBookies, ServerConfiguration baseConf, String localBookiesConfigDirName, boolean stopOnExit, String dirSuffix, String zkHost, int zkPort) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()static LocalBookKeepergetLocalBookies(String zkHost, int zkPort, int numBookies, boolean shouldStartZK, ServerConfiguration conf) static voidvoidstatic ZooKeeperServerShimrunZookeeper(int maxCC, int zookeeperPort) static ZooKeeperServerShimrunZookeeper(int maxCC, int zookeeperPort, File zkDir) voidvoidstart()static booleanwaitForServerUp(String hp, long timeout)
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
CONNECTION_TIMEOUT
public static final int CONNECTION_TIMEOUT- See Also:
-
numberOfBookies
int numberOfBookies -
localBookies
List<org.apache.bookkeeper.util.LocalBookKeeper.LocalBookie> localBookies -
zks
-
zkHost
String zkHost -
zkPort
int zkPort -
dirSuffix
String dirSuffix -
allocator
ByteBufAllocatorWithOomHandler allocator -
localBookiesConfigDir
File localBookiesConfigDir -
dirsToCleanUp
-
stopOnExit
boolean stopOnExit
-
-
Constructor Details
-
LocalBookKeeper
public LocalBookKeeper(int numberOfBookies, ServerConfiguration baseConf, String localBookiesConfigDirName, boolean stopOnExit, String dirSuffix, String zkHost, int zkPort)
-
-
Method Details
-
runZookeeper
- Parameters:
maxCC- Max Concurrency of ClientzookeeperPort- ZooKeeper Server Port- Throws:
IOException
-
runZookeeper
public static ZooKeeperServerShim runZookeeper(int maxCC, int zookeeperPort, File zkDir) throws IOException - Throws:
IOException
-
getLocalBookies
public static LocalBookKeeper getLocalBookies(String zkHost, int zkPort, int numBookies, boolean shouldStartZK, ServerConfiguration conf) throws Exception - Throws:
Exception
-
main
-
waitForServerUp
-
start
- Throws:
Exception
-
addBookie
- Throws:
Exception
-
removeBookie
- Throws:
Exception
-
shutdownBookies
- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-