Interface ZooKeeperRegistrationSpec
public interface ZooKeeperRegistrationSpec
A registration specification for
ZooKeeperUpdatingListener
. The specification is used for encoding
and registering the Server
to ZooKeeper.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuilderForCurator
(String serviceName) Returns a newCuratorRegistrationSpecBuilder
.Returns a newServerSetsRegistrationSpecBuilder
.static ZooKeeperRegistrationSpec
Returns theZooKeeperRegistrationSpec
that registers theServer
using the format of Curator Service Discovery.byte[]
Returns the byte array representation of theServer
.boolean
Tells whether to create the ZooKeeper node usingCreateMode.EPHEMERAL_SEQUENTIAL
or not.static ZooKeeperRegistrationSpec
legacy()
Returns theZooKeeperRegistrationSpec
that registers theServer
usingSystemInfo.defaultNonLoopbackIpV4Address()
as ahost
andServer.activePort()
as aport_number
.static ZooKeeperRegistrationSpec
path()
Returns the path for registering theServer
.static ZooKeeperRegistrationSpec
Returns theZooKeeperRegistrationSpec
that registers theServer
using the format of Finagle ServerSets.
-
Method Details
-
curator
Returns theZooKeeperRegistrationSpec
that registers theServer
using the format of Curator Service Discovery. This is also compatible with Spring Cloud Zookeeper.- See Also:
-
builderForCurator
Returns a newCuratorRegistrationSpecBuilder
. The specification is compatible with Curator Service Discovery and Spring Cloud Zookeeper. -
serverSets
Returns theZooKeeperRegistrationSpec
that registers theServer
using the format of Finagle ServerSets.- See Also:
-
builderForServerSets
Returns a newServerSetsRegistrationSpecBuilder
. The specification is compatible with Finagle ServerSets.- See Also:
-
legacy
Returns theZooKeeperRegistrationSpec
that registers theServer
usingSystemInfo.defaultNonLoopbackIpV4Address()
as ahost
andServer.activePort()
as aport_number
. Thehost
andport_number
are encoded to a comma-separated string whose format is<host>[:<port_number>[:weight]]
, such as:"foo.com"
- default port number, default weight (1000)"bar.com:8080
- port number 8080, default weight (1000)"10.0.2.15:0:500
- default port number, weight 500"192.168.1.2:8443:700
- port number 8443, weight 700
- See Also:
-
legacy
Returns theZooKeeperRegistrationSpec
that registers theServer
using the specifiedEndpoint
. TheEndpoint
is encoded to a comma-separated string whose format is<host>[:<port_number>[:weight]]
, such as:"foo.com"
- default port number, default weight (1000)"bar.com:8080
- port number 8080, default weight (1000)"10.0.2.15:0:500
- default port number, weight 500"192.168.1.2:8443:700
- port number 8443, weight 700
- See Also:
-
path
String path()Returns the path for registering theServer
. The path is appended to theznodePath
that is specified when creatingZooKeeperUpdatingListener
. -
isSequential
boolean isSequential()Tells whether to create the ZooKeeper node usingCreateMode.EPHEMERAL_SEQUENTIAL
or not. -
encodedInstance
byte[] encodedInstance()Returns the byte array representation of theServer
.
-