org.apache.hadoop.hdfs.shortcircuit
Class DfsClientShm
java.lang.Object
org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm
org.apache.hadoop.hdfs.shortcircuit.DfsClientShm
- All Implemented Interfaces:
- org.apache.hadoop.net.unix.DomainSocketWatcher.Handler
public class DfsClientShm
- extends ShortCircuitShm
- implements org.apache.hadoop.net.unix.DomainSocketWatcher.Handler
DfsClientShm is a subclass of ShortCircuitShm which is used by the
DfsClient.
When the UNIX domain socket associated with this shared memory segment
closes unexpectedly, we mark the slots inside this segment as disconnected.
ShortCircuitReplica objects that contain disconnected slots are stale,
and will not be used to service new reads or mmap operations.
However, in-progress read or mmap operations will continue to proceed.
Once the last slot is deallocated, the segment can be safely munmapped.
Slots may also become stale because the associated replica has been deleted
on the DataNode. In this case, the DataNode will clear the 'valid' bit.
The client will then see these slots as stale (see
#{ShortCircuitReplica#isStale}).
Method Summary |
org.apache.hadoop.hdfs.shortcircuit.DfsClientShmManager.EndpointShmManager |
getEndpointShmManager()
|
org.apache.hadoop.hdfs.net.DomainPeer |
getPeer()
|
boolean |
handle(org.apache.hadoop.net.unix.DomainSocket sock)
Handle the closure of the UNIX domain socket associated with this shared
memory segment by marking this segment as stale. |
boolean |
isDisconnected()
Determine if the shared memory segment is disconnected from the DataNode. |
getEndpointShmManager
public org.apache.hadoop.hdfs.shortcircuit.DfsClientShmManager.EndpointShmManager getEndpointShmManager()
getPeer
public org.apache.hadoop.hdfs.net.DomainPeer getPeer()
isDisconnected
public boolean isDisconnected()
- Determine if the shared memory segment is disconnected from the DataNode.
This must be called with the DfsClientShmManager lock held.
- Returns:
- True if the shared memory segment is stale.
handle
public boolean handle(org.apache.hadoop.net.unix.DomainSocket sock)
- Handle the closure of the UNIX domain socket associated with this shared
memory segment by marking this segment as stale.
If there are no slots associated with this shared memory segment, it will
be freed immediately in this function.
- Specified by:
handle
in interface org.apache.hadoop.net.unix.DomainSocketWatcher.Handler
Copyright © 2014 Apache Software Foundation. All Rights Reserved.