Class ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
java.lang.Object
org.apache.zookeeper.server.embedded.ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
- Enclosing interface:
ZooKeeperServerEmbedded
Builder for ZooKeeperServerEmbedded.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBase directory of the server.build()
Validate the configuration and create the server, without starting it.configuration
(Properties configuration) Set the contents of the main configuration as it would be in zk_server.conf file.exitHandler
(ExitHandler exitHandler) Set the behaviour in case of hard system errors, seeExitHandler
.
-
Constructor Details
-
ZookKeeperServerEmbeddedBuilder
public ZookKeeperServerEmbeddedBuilder()
-
-
Method Details
-
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
Set the behaviour in case of hard system errors, seeExitHandler
.- Parameters:
exitHandler
- the handler- Returns:
- the builder
-
build
Validate the configuration and create the server, without starting it.- Returns:
- the new server
- Throws:
Exception
- See Also:
-