Package org.apache.hadoop.hdfs
Class DeadNodeDetector
java.lang.Object
java.lang.Thread
org.apache.hadoop.util.Daemon
org.apache.hadoop.hdfs.DeadNodeDetector
- All Implemented Interfaces:
Runnable
public class DeadNodeDetector
extends org.apache.hadoop.util.Daemon
Detect the dead nodes in advance, and share this information among all the
DFSInputStreams in the same client.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.util.Daemon
org.apache.hadoop.util.Daemon.DaemonFactoryNested classes/interfaces inherited from class java.lang.Thread
Thread.UncaughtExceptionHandler -
Field Summary
FieldsFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNodeToDetect(DFSInputStream dfsInputStream, DatanodeInfo datanodeInfo) Add datanode to suspectNodes and suspectAndDeadNodes.Remove dead node which is not used by any DFSInputStream from deadNodes.org.apache.hadoop.hdfs.DeadNodeDetector.UniqueQueue<DatanodeInfo>org.apache.hadoop.hdfs.DeadNodeDetector.UniqueQueue<DatanodeInfo>booleanisDeadNode(DatanodeInfo datanodeInfo) voidremoveNodeFromDeadNodeDetector(DFSInputStream dfsInputStream, DatanodeInfo datanodeInfo) Remove suspect and dead node from suspectAndDeadNodes#dfsInputStream and local deadNodes.voidshutdown()Shutdown all the threads.voidwork()Methods inherited from class org.apache.hadoop.util.Daemon
getRunnable, run, startMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
DeadNodeDetector
-
-
Method Details
-
work
public void work()- Overrides:
workin classorg.apache.hadoop.util.Daemon
-
shutdown
public void shutdown()Shutdown all the threads. -
isDeadNode
-
getDeadNodesProbeQueue
-
getSuspectNodesProbeQueue
public org.apache.hadoop.hdfs.DeadNodeDetector.UniqueQueue<DatanodeInfo> getSuspectNodesProbeQueue() -
addNodeToDetect
Add datanode to suspectNodes and suspectAndDeadNodes. -
clearAndGetDetectedDeadNodes
Remove dead node which is not used by any DFSInputStream from deadNodes.- Returns:
- new dead node shared by all DFSInputStreams.
-
removeNodeFromDeadNodeDetector
public void removeNodeFromDeadNodeDetector(DFSInputStream dfsInputStream, DatanodeInfo datanodeInfo) Remove suspect and dead node from suspectAndDeadNodes#dfsInputStream and local deadNodes.
-