Class ClientCache

java.lang.Object
org.apache.hadoop.ipc.ClientCache

@LimitedPrivate({"HDFS","MapReduce"}) @Evolving public class ClientCache extends Object
  • Constructor Details

    • ClientCache

      public ClientCache()
  • Method Details

    • getClient

      public Client getClient(Configuration conf, SocketFactory factory, Class<? extends Writable> valueClass)
      Construct & cache an IPC client with the user-provided SocketFactory if no cached client exists.
      Parameters:
      conf - Configuration
      factory - SocketFactory for client socket
      valueClass - Class of the expected response
      Returns:
      an IPC client
    • getClient

      public Client getClient(Configuration conf)
      Construct & cache an IPC client with the default SocketFactory and default valueClass if no cached client exists.
      Parameters:
      conf - Configuration
      Returns:
      an IPC client
    • getClient

      public Client getClient(Configuration conf, SocketFactory factory)
      Construct & cache an IPC client with the user-provided SocketFactory if no cached client exists. Default response type is ObjectWritable.
      Parameters:
      conf - Configuration
      factory - SocketFactory for client socket
      Returns:
      an IPC client
    • stopClient

      public void stopClient(Client client)
      Stop a RPC client connection A RPC client is closed only when its reference count becomes zero.
      Parameters:
      client - input client.
    • clearCache

      @VisibleForTesting public void clearCache()