Interface ZooKeeperServerEmbedded
- 
- All Superinterfaces:
- AutoCloseable
 
 @Public @Evolving public interface ZooKeeperServerEmbedded extends AutoCloseable This API allows you to start a ZooKeeper server node from Java codeThe server will run inside the same process. Typical usecases are: - Running automated tests
- Launch ZooKeeper server with a Java based service management system
 Please take into consideration that in production usually it is better to not run the client together with the server in order to avoid race conditions, especially around how ephemeral nodes work. 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilderBuilder for ZooKeeperServerEmbedded.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilderbuilder()voidclose()Shutdown gracefully the server and wait for resources to be released.StringgetConnectionString()Get a connection string useful for the client.StringgetSecureConnectionString()voidstart()Start the server.voidstart(long startupTimeout)Start the server
 
- 
- 
- 
Method Detail- 
builderstatic ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder builder() 
 - 
startvoid start(long startupTimeout) throws ExceptionStart the server- Parameters:
- startupTimeout- time to wait in millis for the server to start
- Throws:
- Exception
 
 - 
getConnectionStringString getConnectionString() throws Exception Get a connection string useful for the client.- Returns:
- the connection string
- Throws:
- Exception- in case the connection string is not available
 
 - 
closevoid close() Shutdown gracefully the server and wait for resources to be released.- Specified by:
- closein interface- AutoCloseable
 
 
- 
 
-