Class ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
- java.lang.Object
-
- org.apache.zookeeper.server.embedded.ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
-
- Enclosing interface:
- ZooKeeperServerEmbedded
public static class ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder extends Object
Builder for ZooKeeperServerEmbedded.
-
-
Constructor Summary
Constructors Constructor Description ZookKeeperServerEmbeddedBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
baseDir(Path baseDir)
Base directory of the server.ZooKeeperServerEmbedded
build()
Validate the configuration and create the server, without starting it.ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
configuration(Properties configuration)
Set the contents of the main configuration as it would be in zk_server.conf file.ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
exitHandler(ExitHandler exitHandler)
Set the behaviour in case of hard system errors, seeExitHandler
.
-
-
-
Method Detail
-
baseDir
public ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder baseDir(Path baseDir)
Base directory of the server. The system will create a temporary configuration file inside this directory. Please remember that dynamic configuration files wil be saved into this directory by default.If you do not set a 'dataDir' configuration entry the system will use a subdirectory of baseDir.
- Parameters:
baseDir
-- Returns:
- the builder
-
configuration
public ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder configuration(Properties configuration)
Set the contents of the main configuration as it would be in zk_server.conf file.- Parameters:
configuration
- the configuration- Returns:
- the builder
-
exitHandler
public ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder exitHandler(ExitHandler exitHandler)
Set the behaviour in case of hard system errors, seeExitHandler
.- Parameters:
exitHandler
- the handler- Returns:
- the builder
-
build
public ZooKeeperServerEmbedded build() throws Exception
Validate the configuration and create the server, without starting it.- Returns:
- the new server
- Throws:
Exception
- See Also:
ZooKeeperServerEmbedded.start()
-
-