Class ClientContext

java.lang.Object
org.apache.hadoop.hdfs.ClientContext

@Private public class ClientContext extends Object
ClientContext contains context information for a client. This allows us to share caches such as the socket cache across DFSClient instances.
  • Method Details

    • get

      public static ClientContext get(String name, DfsClientConf conf, org.apache.hadoop.conf.Configuration config)
    • get

      public static ClientContext get(String name, org.apache.hadoop.conf.Configuration config)
    • 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

      public String getConfString()
    • getShortCircuitCache

      public ShortCircuitCache getShortCircuitCache()
    • getShortCircuitCache

      public ShortCircuitCache getShortCircuitCache(long idx)
    • getPeerCache

      public PeerCache getPeerCache()
    • getKeyProviderCache

      public KeyProviderCache getKeyProviderCache()
    • getUseLegacyBlockReaderLocal

      public boolean getUseLegacyBlockReaderLocal()
    • getDisableLegacyBlockReaderLocal

      public boolean getDisableLegacyBlockReaderLocal()
    • setDisableLegacyBlockReaderLocal

      public void setDisableLegacyBlockReaderLocal()
    • getDomainSocketFactory

      public DomainSocketFactory getDomainSocketFactory()
    • getByteArrayManager

      public ByteArrayManager getByteArrayManager()
    • getNetworkDistance

      public int getNetworkDistance(DatanodeInfo datanodeInfo) throws IOException
      Throws:
      IOException
    • isDeadNodeDetectionEnabled

      public boolean isDeadNodeDetectionEnabled()
      The switch to DeadNodeDetector. If true, DeadNodeDetector is available.
    • getDeadNodeDetector

      public DeadNodeDetector getDeadNodeDetector()
      Obtain DeadNodeDetector of the current client.
    • isLocatedBlocksRefresherEnabled

      public boolean isLocatedBlocksRefresherEnabled()
      If true, LocatedBlocksRefresher will be periodically refreshing LocatedBlocks of registered DFSInputStreams.
    • getLocatedBlocksRefresher

      public LocatedBlocksRefresher getLocatedBlocksRefresher()
      Obtain LocatedBlocksRefresher of the current client.