Package org.apache.storm.utils

# Class SupervisorClient

java.lang.Object
org.apache.storm.security.auth.ThriftClient
org.apache.storm.utils.SupervisorClient

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `SupervisorIfaceFactory`

public class SupervisorClient extends ThriftClient implements SupervisorIfaceFactory
Client for interacting with Supervisor server, now we use supervisor server mainly for cases below.

- worker <- supervisor: get worker local assignment for a storm.
- nimbus -> supervisor: assign assignments for a node.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `SupervisorClient.Builder`

- ## Field Summary

  ### Fields inherited from class org.apache.storm.security.auth.ThriftClient

  `protocol, retryForever`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SupervisorClient(Map conf, String host)`
  Deprecated.
  use `#build()` instead.
  `SupervisorClient(Map conf, String host, int port)`
  Deprecated.
  use `#build()` instead.
  `SupervisorClient(Map conf, String host, int port, Integer timeout)`
  Deprecated.
  use `#build()` instead.
  `SupervisorClient(Map conf, String host, Integer port, Integer timeout, String asUser)`
  Deprecated.
  use `#build()` instead.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static SupervisorClient`
  `getConfiguredClient(Map conf, String host)`
  Deprecated.
  use `#createSupervisorClient()` instead.
  `static SupervisorClient`
  `getConfiguredClient(Map conf, String host, int port)`
  Deprecated.
  use `#createSupervisorClient()` instead.
  `static SupervisorClient`
  `getConfiguredClientAs(Map conf, String host, int port, String asUser)`
  Deprecated.
  use `#createSupervisorClient()` instead.
  `Supervisor.Client`
  `getIface()`

  ### Methods inherited from class org.apache.storm.security.auth.ThriftClient

  `close, getKeyStoreFile, getPrivateKey, reconnect, transport`

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

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

  ### Methods inherited from interface org.apache.storm.utils.SupervisorIfaceFactory

  `close`

- ## Constructor Details

  - ### SupervisorClient

    @Deprecated public SupervisorClient(Map conf, String host, int port) throws org.apache.storm.thrift.transport.TTransportException
    Deprecated.
    use `#build()` instead.
    Constructor.
    Parameters:
      `conf` - the conf for the client.
      `host` - the host the client is to talk to.
      `port` - the port for the client.
    Throws:
      `org.apache.storm.thrift.transport.TTransportException` - on any error.

  - ### SupervisorClient

    @Deprecated public SupervisorClient(Map conf, String host, int port, Integer timeout) throws org.apache.storm.thrift.transport.TTransportException
    Deprecated.
    use `#build()` instead.
    Constructor.
    Parameters:
      `conf` - the conf for the client.
      `host` - the host the client is to talk to.
      `port` - the port for the client.
      `timeout` - the timeout for the client.
    Throws:
      `org.apache.storm.thrift.transport.TTransportException` - on any error.

  - ### SupervisorClient

    @Deprecated public SupervisorClient(Map conf, String host, Integer port, Integer timeout, String asUser) throws org.apache.storm.thrift.transport.TTransportException
    Deprecated.
    use `#build()` instead.
    Constructor.
    Parameters:
      `conf` - the conf for the client.
      `host` - the host the client is to talk to.
      `port` - the port for the client.
      `timeout` - the timeout for the client.
      `asUser` - the asUser for the client.
    Throws:
      `org.apache.storm.thrift.transport.TTransportException` - on any error.

  - ### SupervisorClient

    @Deprecated public SupervisorClient(Map conf, String host) throws org.apache.storm.thrift.transport.TTransportException
    Deprecated.
    use `#build()` instead.
    Constructor.
    Parameters:
      `conf` - the conf for the client.
      `host` - the host the client is to talk to.
    Throws:
      `org.apache.storm.thrift.transport.TTransportException` - on any error.

- ## Method Details

  - ### getConfiguredClient

    @Deprecated public static SupervisorClient getConfiguredClient(Map conf, String host)
    Deprecated.
    use `#createSupervisorClient()` instead.
    Get a supervisor client as configured by conf.
    Parameters:
      `conf` - the configuration to use.
      `host` - the host to use.
    Returns:
      the client, don't forget to close it when done.

  - ### getConfiguredClient

    @Deprecated public static SupervisorClient getConfiguredClient(Map conf, String host, int port)
    Deprecated.
    use `#createSupervisorClient()` instead.
    Get a supervisor client as configured by conf.
    Parameters:
      `conf` - the configuration to use.
      `host` - the host to use.
      `port` - the port to use.
    Returns:
      the client, don't forget to close it when done.

  - ### getConfiguredClientAs

    @Deprecated public static SupervisorClient getConfiguredClientAs(Map conf, String host, int port, String asUser)
    Deprecated.
    use `#createSupervisorClient()` instead.
    Get a supervisor client as configured by conf.
    Parameters:
      `conf` - the configuration to use.
      `host` - the host to use.
      `port` - the port to use.
      `asUser` - the asUser.
    Returns:
      the client, don't forget to close it when done.

  - ### getIface

    public Supervisor.Client getIface()
    Specified by:
      `getIface` in interface `SupervisorIfaceFactory`