org.apache.hadoop.yarn.lib

## Class ZKClient

- java.lang.Object
- - org.apache.hadoop.yarn.lib.ZKClient

-     public class ZKClient
      extends Object

  ZK Registration Library currently does not use any authorization

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZKClient(String string)` the zookeeper client library to talk to zookeeper

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getServiceData(String path)` get data published by the service at the registration address
    `List<String>` | `listServices(String path)` list the services registered under a path
    `void` | `registerService(String path, String data)` register the service to a specific path
    `void` | `unregisterService(String path)` unregister the service.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ZKClient

          public ZKClient(String string)
                   throws IOException

      the zookeeper client library to talk to zookeeper
      Parameters:
        `string` - the host
      Throws:
        `IOException`

  - ### Method Detail

    - #### registerService

          public void registerService(String path,
                                      String data)
                               throws IOException,
                                      InterruptedException

      register the service to a specific path
      Parameters:
        `path` - the path in zookeeper namespace to register to
        `data` - the data that is part of this registration
      Throws:
        `IOException`
        `InterruptedException`

    - #### unregisterService

          public void unregisterService(String path)
                                 throws IOException,
                                        InterruptedException

      unregister the service.
      Parameters:
        `path` - the path at which the service was registered
      Throws:
        `IOException`
        `InterruptedException`

    - #### listServices

          public List<String> listServices(String path)
                                    throws IOException,
                                           InterruptedException

      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`
        `InterruptedException`

    - #### getServiceData

          public String getServiceData(String path)
                                throws IOException,
                                       InterruptedException

      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`
        `InterruptedException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.