Package org.apache.storm.utils

## Class DRPCClient

- java.lang.Object
- - org.apache.storm.security.auth.ThriftClient
  - - org.apache.storm.utils.DRPCClient

- All Implemented Interfaces:
    `AutoCloseable`, `DistributedRPC.Iface`

      public class DRPCClient
      extends ThriftClient
      implements DistributedRPC.Iface

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `DRPCClient.LocalOverride` |

  - ### Field Summary

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

      `protocol, retryForever`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DRPCClient​(Map<String,​Object> conf, String host, int port)` |
    `DRPCClient​(Map<String,​Object> conf, String host, int port, Integer timeout)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `execute​(String func, String args)` |
    `DistributedRPC.Iface` | `getClient()` |
    `static DRPCClient` | `getConfiguredClient​(Map<String,​Object> conf)` |
    `String` | `getHost()` |
    `static String` | `getOverrideServiceId()` | Get override service ID.
    `int` | `getPort()` |
    `static boolean` | `isLocalOverride()` | Check local override.

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

- - ### Constructor Detail

    - #### DRPCClient

          public DRPCClient​(Map<String,​Object> conf,
                            String host,
                            int port)
                     throws org.apache.storm.thrift.transport.TTransportException

      Throws:
        `org.apache.storm.thrift.transport.TTransportException`

    - #### DRPCClient

          public DRPCClient​(Map<String,​Object> conf,
                            String host,
                            int port,
                            Integer timeout)
                     throws org.apache.storm.thrift.transport.TTransportException

      Throws:
        `org.apache.storm.thrift.transport.TTransportException`

  - ### Method Detail

    - #### isLocalOverride

          public static boolean isLocalOverride()

      Check local override.
      Returns:
        true of new clients will be overridden to connect to a local cluster and not the configured remote cluster

    - #### getOverrideServiceId

          public static String getOverrideServiceId()

      Get override service ID.
      Returns:
        the service ID of the local override DRPC instance

    - #### getConfiguredClient

          public static DRPCClient getConfiguredClient​(Map<String,​Object> conf)
                                                throws org.apache.storm.thrift.transport.TTransportException

      Throws:
        `org.apache.storm.thrift.transport.TTransportException`

    - #### getHost

          public String getHost()

    - #### getPort

          public int getPort()

    - #### execute

          public String execute​(String func,
                                String args)
                         throws org.apache.storm.thrift.TException,
                                DRPCExecutionException,
                                AuthorizationException

      Specified by:
        `execute` in interface `DistributedRPC.Iface`
      Throws:
        `org.apache.storm.thrift.TException`
        `DRPCExecutionException`
        `AuthorizationException`

    - #### getClient

          public DistributedRPC.Iface getClient()