Package org.apache.hadoop.ipc
Class ClientCache
java.lang.Object
org.apache.hadoop.ipc.ClientCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetClient(Configuration conf) Construct & cache an IPC client with the default SocketFactory and default valueClass if no cached client exists.getClient(Configuration conf, SocketFactory factory) Construct & cache an IPC client with the user-provided SocketFactory if no cached client exists.getClient(Configuration conf, SocketFactory factory, Class<? extends Writable> valueClass) Construct & cache an IPC client with the user-provided SocketFactory if no cached client exists.voidstopClient(Client client) Stop a RPC client connection A RPC client is closed only when its reference count becomes zero.
-
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- Configurationfactory- SocketFactory for client socketvalueClass- Class of the expected response- Returns:
- an IPC client
-
getClient
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
Construct & cache an IPC client with the user-provided SocketFactory if no cached client exists. Default response type is ObjectWritable.- Parameters:
conf- Configurationfactory- SocketFactory for client socket- Returns:
- an IPC client
-
stopClient
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()
-