DfsClientShmManager (Apache Hadoop HDFS Client 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.shortcircuit, class: DfsClientShmManager

Package org.apache.hadoop.hdfs.shortcircuit

# Class DfsClientShmManager

java.lang.Object
org.apache.hadoop.hdfs.shortcircuit.DfsClientShmManager

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

@Private public class DfsClientShmManager extends Object implements Closeable
Manages short-circuit memory segments for an HDFS client. Clients are responsible for requesting and releasing shared memory segments used for communicating with the DataNode. The client will try to allocate new slots in the set of existing segments, falling back to getting a new segment from the DataNode via `DataTransferProtocol.requestShortCircuitFds(org.apache.hadoop.hdfs.protocol.ExtendedBlock, org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier>, org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.SlotId, int, boolean)`. The counterpart to this class on the DataNode is ShortCircuitRegistry. See ShortCircuitRegistry for more information on the communication protocol.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DfsClientShmManager.PerDatanodeVisitorInfo`
  `static interface`
  `DfsClientShmManager.Visitor`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ShortCircuitShm.Slot`
  `allocSlot(DatanodeInfo datanode, DomainPeer peer, org.apache.commons.lang3.mutable.MutableBoolean usedPeer, ExtendedBlockId blockId, String clientName)`
  `void`
  `close()`
  Close the DfsClientShmManager.
  `void`
  `freeSlot(ShortCircuitShm.Slot slot)`
  `org.apache.hadoop.net.unix.DomainSocketWatcher`
  `getDomainSocketWatcher()`
  `int`
  `getShmNum()`
  `String`
  `toString()`
  `void`
  `visit(DfsClientShmManager.Visitor visitor)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### allocSlot

    public ShortCircuitShm.Slot allocSlot(DatanodeInfo datanode, DomainPeer peer, org.apache.commons.lang3.mutable.MutableBoolean usedPeer, ExtendedBlockId blockId, String clientName) throws IOException
    Throws:
      `IOException`

  - ### freeSlot

    public void freeSlot(ShortCircuitShm.Slot slot)

  - ### visit

    @VisibleForTesting public void visit(DfsClientShmManager.Visitor visitor) throws IOException
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Close the DfsClientShmManager.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getDomainSocketWatcher

    @VisibleForTesting public org.apache.hadoop.net.unix.DomainSocketWatcher getDomainSocketWatcher()

  - ### getShmNum

    @VisibleForTesting public int getShmNum()