public class ConnectionContext
extends java.lang.Object
ConnectionPool. When a client uses
a connection, it increments a counter to mark it as active. Once the client
is done with the connection, it decreases the counter. It also takes care of
closing the connection once is not active.
The protocols currently used are:
ClientProtocol
NamenodeProtocol
| Constructor | Description |
|---|---|
ConnectionContext(org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<?> connection,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
close(boolean force) |
Close a connection.
|
org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<?> |
getClient() |
Get the connection client.
|
boolean |
isActive() |
Check if the connection is active.
|
boolean |
isActiveRecently() |
Check if the connection is/was active recently.
|
boolean |
isClosed() |
Check if the connection is closed.
|
boolean |
isIdle() |
Check if the connection is idle.
|
boolean |
isUsable() |
Check if the connection can be used.
|
void |
release() |
Release this connection.
|
java.lang.String |
toString() |
public ConnectionContext(org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<?> connection,
org.apache.hadoop.conf.Configuration conf)
public boolean isActive()
public boolean isActiveRecently()
public boolean isClosed()
public boolean isUsable()
public boolean isIdle()
public org.apache.hadoop.hdfs.NameNodeProxiesClient.ProxyAndInfo<?> getClient()
public void release()
public void close(boolean force)
force - whether the connection should be closed anyway.public void close()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.