Class DfsClientShmManager
java.lang.Object
org.apache.hadoop.hdfs.shortcircuit.DfsClientShmManager
- All Implemented Interfaces:
Closeable,AutoCloseable
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 ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Method Summary
Modifier and TypeMethodDescriptionallocSlot(DatanodeInfo datanode, DomainPeer peer, org.apache.commons.lang3.mutable.MutableBoolean usedPeer, ExtendedBlockId blockId, String clientName) voidclose()Close the DfsClientShmManager.voidfreeSlot(ShortCircuitShm.Slot slot) org.apache.hadoop.net.unix.DomainSocketWatcherinttoString()voidvisit(DfsClientShmManager.Visitor visitor)
-
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
-
visit
- Throws:
IOException
-
close
Close the DfsClientShmManager.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-
getDomainSocketWatcher
@VisibleForTesting public org.apache.hadoop.net.unix.DomainSocketWatcher getDomainSocketWatcher() -
getShmNum
@VisibleForTesting public int getShmNum()
-