Interface ZooKeeperDiscoverySpec
public interface ZooKeeperDiscoverySpec
A discovery specification for
ZooKeeperEndpointGroup
. The specification is used for finding
and decoding the registered instances into Endpoint
s.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic CuratorDiscoverySpecBuilder
builderForCurator
(String serviceName) Returns a newCuratorDiscoverySpecBuilder
.static ZooKeeperDiscoverySpec
Returns aZooKeeperDiscoverySpec
that is compatible with Curator Service Discovery.decode
(byte[] data) Decodes a znode value to anEndpoint
.static ZooKeeperDiscoverySpec
legacy()
Returns the legacyZooKeeperDiscoverySpec
implementation which assumes a znode value is a comma-separated string.path()
Returns the path for finding the byte array representation of registered instances.static ZooKeeperDiscoverySpec
Returns aZooKeeperDiscoverySpec
that is compatible with Finagle ServerSets.static ZooKeeperDiscoverySpec
serverSets
(Function<? super ServerSetsInstance, Endpoint> converter) Returns aZooKeeperDiscoverySpec
that is compatible with Finagle ServerSets.
-
Method Details
-
curator
Returns aZooKeeperDiscoverySpec
that is compatible with Curator Service Discovery. This is also compatible with Spring Cloud Zookeeper. -
builderForCurator
Returns a newCuratorDiscoverySpecBuilder
. The specification is compatible with Curator Service Discovery and Spring Cloud Zookeeper. -
serverSets
Returns aZooKeeperDiscoverySpec
that is compatible with Finagle ServerSets. -
serverSets
Returns aZooKeeperDiscoverySpec
that is compatible with Finagle ServerSets.- Parameters:
converter
- the converter to convert aServerSetsInstance
to anEndpoint
. If you don't want to connect to the service, you can simply returnnull
in the converter.- See Also:
-
legacy
Returns the legacyZooKeeperDiscoverySpec
implementation which assumes a znode value is a comma-separated string. Each element of the znode value represents anEndpoint
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
Returns the path for finding the byte array representation of registered instances. The path is appended to theznodePath
that is specified when creatingZooKeeperEndpointGroup
. -
decode
Decodes a znode value to anEndpoint
.
-