Package org.apache.hadoop.hdfs
Class ClientContext
java.lang.Object
org.apache.hadoop.hdfs.ClientContext
ClientContext contains context information for a client.
This allows us to share caches such as the socket cache across
DFSClient instances.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClientContextstatic ClientContextget(String name, DfsClientConf conf, org.apache.hadoop.conf.Configuration config) Obtain DeadNodeDetector of the current client.booleanstatic ClientContextgetFromConf(org.apache.hadoop.conf.Configuration conf) Get a client context, from a Configuration object.Obtain LocatedBlocksRefresher of the current client.intgetNetworkDistance(DatanodeInfo datanodeInfo) getShortCircuitCache(long idx) booleanbooleanThe switch to DeadNodeDetector.booleanIf true, LocatedBlocksRefresher will be periodically refreshing LocatedBlocks of registered DFSInputStreams.void
-
Method Details
-
get
public static ClientContext get(String name, DfsClientConf conf, org.apache.hadoop.conf.Configuration config) -
get
-
getFromConf
@VisibleForTesting public static ClientContext getFromConf(org.apache.hadoop.conf.Configuration conf) Get a client context, from a Configuration object. This method is less efficient than the version which takes a DFSClient#Conf object, and should be mostly used by tests. -
getConfString
-
getShortCircuitCache
-
getShortCircuitCache
-
getPeerCache
-
getKeyProviderCache
-
getUseLegacyBlockReaderLocal
public boolean getUseLegacyBlockReaderLocal() -
getDisableLegacyBlockReaderLocal
public boolean getDisableLegacyBlockReaderLocal() -
setDisableLegacyBlockReaderLocal
public void setDisableLegacyBlockReaderLocal() -
getDomainSocketFactory
-
getByteArrayManager
-
getNetworkDistance
- Throws:
IOException
-
isDeadNodeDetectionEnabled
public boolean isDeadNodeDetectionEnabled()The switch to DeadNodeDetector. If true, DeadNodeDetector is available. -
getDeadNodeDetector
Obtain DeadNodeDetector of the current client. -
isLocatedBlocksRefresherEnabled
public boolean isLocatedBlocksRefresherEnabled()If true, LocatedBlocksRefresher will be periodically refreshing LocatedBlocks of registered DFSInputStreams. -
getLocatedBlocksRefresher
Obtain LocatedBlocksRefresher of the current client.
-