Package org.apache.hadoop.yarn.lib
Class ZKClient
java.lang.Object
org.apache.hadoop.yarn.lib.ZKClient
ZK Registration Library
currently does not use any authorization
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetServiceData(String path) get data published by the service at the registration address.listServices(String path) list the services registered under a path.voidregisterService(String path, String data) register the service to a specific path.voidunregisterService(String path) unregister the service.
-
Constructor Details
-
ZKClient
the zookeeper client library to talk to zookeeper- Parameters:
string- the host- Throws:
IOException- if there are I/O errors.
-
-
Method Details
-
registerService
register the service to a specific path.- Parameters:
path- the path in zookeeper namespace to register todata- the data that is part of this registration- Throws:
IOException- if there are I/O errors.InterruptedException- if any thread has interrupted.
-
unregisterService
unregister the service.- Parameters:
path- the path at which the service was registered- Throws:
IOException- if there are I/O errors.InterruptedException- if any thread has interrupted.
-
listServices
list the services registered under a path.- Parameters:
path- the path under which services are registered- Returns:
- the list of names of services registered
- Throws:
IOException- if there are I/O errors.InterruptedException- if any thread has interrupted.
-
getServiceData
get data published by the service at the registration address.- Parameters:
path- the path where the service is registered- Returns:
- the data of the registered service
- Throws:
IOException- if there are I/O errors.InterruptedException- if any thread has interrupted.
-