org.apache.hadoop.hdfs.client
Class DfsClientShm
java.lang.Object
org.apache.hadoop.hdfs.ShortCircuitShm
org.apache.hadoop.hdfs.client.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 stale.
ShortCircuitReplica objects that contain stale slots are themselves 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.
Method Summary |
org.apache.hadoop.hdfs.client.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 |
isStale()
Determine if the shared memory segment is stale. |
getEndpointShmManager
public org.apache.hadoop.hdfs.client.DfsClientShmManager.EndpointShmManager getEndpointShmManager()
getPeer
public org.apache.hadoop.hdfs.net.DomainPeer getPeer()
isStale
public boolean isStale()
- Determine if the shared memory segment is stale.
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.