Class DataNodeFaultInjector
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.DataNodeFaultInjector
Used for injecting faults in DFSClient and DFSOutputStream tests.
Calls into this are a no-op in production code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbadDecoding(ByteBuffer[] outputs) Used as a hook to inject data pollution into an erasure coding reconstruction.voidUsed as a hook to inject intercept when re-register.voiddelay()Just delay a while.voidUsed as a hook to delay sending the response of the last packet.voidUsed as a hook to inject latency when read block in erasure coding reconstruction process.voidJust delay delete replica a while.voidJust delay run diff record a while.voidJust delay getMetaDataInputStream a while.voiddelaySendingAckToUpstream(String upstreamAddr) voidUsed as a hook to inject intercept when BPOfferService hold lock.voidUsed as a hook to delay writing a packet to disk.voidUsed as a hook to delay writing a packet to os cache.booleanvoidvoidvoidfailPipeline(ReplicaInPipeline replicaInfo, String mirrorAddr) static DataNodeFaultInjectorget()voidvoidUsed as a hook to inject intercept When finish reading from block.voidUsed as a hook to inject intercept when free the block reader buffer.voidlogDelaySendingAckToUpstream(String upstreamAddr, long delayMs) Used as a hook to intercept the latency of sending ack.voidlogDelaySendingPacketDownstream(String mirrAddr, long delayMs) Used as a hook to intercept the latency of sending packet.voidvoidvoidstatic voidset(DataNodeFaultInjector injector) voidvoidstopSendingPacketDownstream(String mirrAddr) voidUsed as a hook to inject failure in erasure coding checksum reconstruction process.voidUsed as a hook to inject failure in erasure coding reconstruction process.voidvoidUsed inDirectoryScanner.reconcile()to wait until a storage is removed, leaving a stale copy ofDirectoryScanner.diffs.void
-
Constructor Details
-
DataNodeFaultInjector
public DataNodeFaultInjector()
-
-
Method Details
-
get
-
set
-
getHdfsBlocksMetadata
public void getHdfsBlocksMetadata() -
writeBlockAfterFlush
- Throws:
IOException
-
sendShortCircuitShmResponse
- Throws:
IOException
-
dropHeartbeatPacket
public boolean dropHeartbeatPacket() -
stopSendingPacketDownstream
- Throws:
IOException
-
logDelaySendingPacketDownstream
Used as a hook to intercept the latency of sending packet.- Throws:
IOException
-
delaySendingAckToUpstream
- Throws:
IOException
-
delayAckLastPacket
Used as a hook to delay sending the response of the last packet.- Throws:
IOException
-
delayWriteToDisk
public void delayWriteToDisk()Used as a hook to delay writing a packet to disk. -
delayWriteToOsCache
public void delayWriteToOsCache()Used as a hook to delay writing a packet to os cache. -
logDelaySendingAckToUpstream
Used as a hook to intercept the latency of sending ack.- Throws:
IOException
-
noRegistration
- Throws:
IOException
-
failMirrorConnection
- Throws:
IOException
-
failPipeline
- Throws:
IOException
-
startOfferService
- Throws:
Exception
-
endOfferService
- Throws:
Exception
-
throwTooManyOpenFiles
- Throws:
FileNotFoundException
-
stripedBlockReconstruction
Used as a hook to inject failure in erasure coding reconstruction process.- Throws:
IOException
-
stripedBlockChecksumReconstruction
Used as a hook to inject failure in erasure coding checksum reconstruction process.- Throws:
IOException
-
delayBlockReader
public void delayBlockReader()Used as a hook to inject latency when read block in erasure coding reconstruction process. -
interceptFreeBlockReaderBuffer
public void interceptFreeBlockReaderBuffer()Used as a hook to inject intercept when free the block reader buffer. -
interceptBlockReader
public void interceptBlockReader()Used as a hook to inject intercept When finish reading from block. -
delayWhenOfferServiceHoldLock
public void delayWhenOfferServiceHoldLock()Used as a hook to inject intercept when BPOfferService hold lock. -
blockUtilSendFullBlockReport
public void blockUtilSendFullBlockReport()Used as a hook to inject intercept when re-register. -
delay
public void delay()Just delay a while. -
badDecoding
Used as a hook to inject data pollution into an erasure coding reconstruction. -
markSlow
-
delayDeleteReplica
public void delayDeleteReplica()Just delay delete replica a while. -
delayDiffRecord
public void delayDiffRecord()Just delay run diff record a while. -
delayGetMetaDataInputStream
public void delayGetMetaDataInputStream()Just delay getMetaDataInputStream a while. -
waitUntilStorageRemoved
public void waitUntilStorageRemoved()Used inDirectoryScanner.reconcile()to wait until a storage is removed, leaving a stale copy ofDirectoryScanner.diffs.
-