org.apache.hadoop.hdfs.server.datanode
Class ShortCircuitRegistry
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.ShortCircuitRegistry
public class ShortCircuitRegistry
- extends Object
Field Summary |
static org.apache.commons.logging.Log |
LOG
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
public static final org.apache.commons.logging.Log LOG
ShortCircuitRegistry
public ShortCircuitRegistry(org.apache.hadoop.conf.Configuration conf)
throws IOException
- Throws:
IOException
removeShm
public void removeShm(ShortCircuitShm shm)
processBlockMlockEvent
public void processBlockMlockEvent(ExtendedBlockId blockId)
- Process a block mlock event from the FsDatasetCache.
- Parameters:
blockId
- The block that was mlocked.
processBlockMunlockRequest
public boolean processBlockMunlockRequest(ExtendedBlockId blockId)
- Mark any slots associated with this blockId as unanchorable.
- Parameters:
blockId
- The block ID.
- Returns:
- True if we should allow the munlock request.
processBlockInvalidation
public void processBlockInvalidation(ExtendedBlockId blockId)
- Invalidate any slot associated with a blockId that we are invalidating
(deleting) from this DataNode. When a slot is invalid, the DFSClient will
not use the corresponding replica for new read or mmap operations (although
existing, ongoing read or mmap operations will complete.)
- Parameters:
blockId
- The block ID.
getClientNames
public String getClientNames(ExtendedBlockId blockId)
createNewMemorySegment
public ShortCircuitRegistry.NewShmInfo createNewMemorySegment(String clientName,
org.apache.hadoop.net.unix.DomainSocket sock)
throws IOException
- Handle a DFSClient request to create a new memory segment.
- Parameters:
clientName
- Client name as reported by the client.sock
- The DomainSocket to associate with this memory
segment. When this socket is closed, or the
other side writes anything to the socket, the
segment will be closed. This can happen at any
time, including right after this function returns.
- Returns:
- A NewShmInfo object. The caller must close the
NewShmInfo object once they are done with it.
- Throws:
IOException
- If the new memory segment could not be created.
registerSlot
public void registerSlot(ExtendedBlockId blockId,
ShortCircuitShm.SlotId slotId,
boolean isCached)
throws org.apache.hadoop.fs.InvalidRequestException
- Throws:
org.apache.hadoop.fs.InvalidRequestException
unregisterSlot
public void unregisterSlot(ShortCircuitShm.SlotId slotId)
throws org.apache.hadoop.fs.InvalidRequestException
- Throws:
org.apache.hadoop.fs.InvalidRequestException
shutdown
public void shutdown()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.