@InterfaceAudience.Public @InterfaceStability.Evolving public interface ZooKeeperServerEmbedded extends AutoCloseable
The server will run inside the same process.
Typical usecases are:
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.
Modifier and Type | Interface and Description |
---|---|
static class |
ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder
Builder for ZooKeeperServerEmbedded.
|
Modifier and Type | Method and Description |
---|---|
static ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder |
builder() |
void |
close()
Shutdown gracefully the server and wait for resources to be released.
|
String |
getConnectionString()
Get a connection string useful for the client.
|
String |
getSecureConnectionString() |
void |
start()
Start the server.
|
void |
start(long startupTimeout)
Start the server
|
static ZooKeeperServerEmbedded.ZookKeeperServerEmbeddedBuilder builder()
void start(long startupTimeout) throws Exception
startupTimeout
- time to wait in millis for the server to startException
String getConnectionString() throws Exception
Exception
- in case the connection string is not availablevoid close()
close
in interface AutoCloseable
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.