Class BKCluster
java.lang.Object
org.apache.pulsar.metadata.bookkeeper.BKCluster
- All Implemented Interfaces:
AutoCloseable
A class runs several bookie servers for testing.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.bookkeeper.conf.ClientConfigurationprotected final org.apache.bookkeeper.conf.ServerConfiguration -
Method Summary
Modifier and TypeMethodDescriptionstatic BKCluster.BKClusterConfbuilder()protected voidvoidclose()static org.apache.bookkeeper.conf.ClientConfigurationorg.apache.bookkeeper.client.BookKeeperprotected voidprotected org.apache.bookkeeper.common.component.LifecycleComponentStackstartBookie(org.apache.bookkeeper.conf.ServerConfiguration conf) Helper method to startup a bookie server using a configuration object.intstartNewBookie(int index) Helper method to startup a new bookie server with the indicated port number.protected voidprotected voidstopAllBookies(boolean shutdownClient) protected voidStop cluster.
-
Field Details
-
baseConf
protected final org.apache.bookkeeper.conf.ServerConfiguration baseConf -
baseClientConf
protected final org.apache.bookkeeper.conf.ClientConfiguration baseClientConf
-
-
Method Details
-
builder
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
newClient
- Throws:
Exception
-
stopBKCluster
Stop cluster. Also, stops all the auto recovery processes for the bookie cluster, if isAutoRecoveryEnabled is true.- Throws:
Exception
-
cleanupTempDirs
- Throws:
Exception
-
stopAllBookies
- Throws:
Exception
-
stopAllBookies
- Throws:
Exception
-
startAllBookies
- Throws:
Exception
-
startNewBookie
Helper method to startup a new bookie server with the indicated port number. Also, starts the auto recovery process, if the isAutoRecoveryEnabled is set true.- Parameters:
index- Bookie index- Throws:
IOExceptionException
-
startBookie
protected org.apache.bookkeeper.common.component.LifecycleComponentStack startBookie(org.apache.bookkeeper.conf.ServerConfiguration conf) throws Exception Helper method to startup a bookie server using a configuration object. Also, starts the auto recovery process if isAutoRecoveryEnabled is true.- Parameters:
conf- Server Configuration Object- Throws:
Exception
-
newBaseClientConfiguration
public static org.apache.bookkeeper.conf.ClientConfiguration newBaseClientConfiguration()
-