Class StripedBlockChecksumReconstructor
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.erasurecode.StripedBlockChecksumReconstructor
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
StripedBlockChecksumCompositeCrcReconstructor,StripedBlockChecksumMd5CrcReconstructor
@Private
public abstract class StripedBlockChecksumReconstructor
extends Object
implements Closeable
StripedBlockChecksumReconstructor reconstruct one or more missed striped
block in the striped block group, the minimum number of live striped blocks
should be no less than data block number. Then checksum will be recalculated
using the newly reconstructed block.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStripedBlockChecksumReconstructor(ErasureCodingWorker worker, StripedReconstructionInfo stripedReconInfo, org.apache.hadoop.io.DataOutputBuffer checksumWriter, long requestedBlockLength) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longlongorg.apache.hadoop.util.DataChecksumlongprotected org.apache.hadoop.io.DataOutputBufferabstract ObjectShould return a representation of a completed/reconstructed digest which is suitable for debug printing.longvoidincrBytesRead(boolean local, long delta) voidincrBytesWritten(long delta) protected voidprotected voidprotected static voidmarkBuffers(ByteBuffer[] buffers) voidprotected static voidresetBuffers(ByteBuffer[] buffers)
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
StripedBlockChecksumReconstructor
protected StripedBlockChecksumReconstructor(ErasureCodingWorker worker, StripedReconstructionInfo stripedReconInfo, org.apache.hadoop.io.DataOutputBuffer checksumWriter, long requestedBlockLength) throws IOException - Throws:
IOException
-
-
Method Details
-
reconstruct
- Throws:
IOException
-
getDigestObject
Should return a representation of a completed/reconstructed digest which is suitable for debug printing. -
getChecksumWriter
protected org.apache.hadoop.io.DataOutputBuffer getChecksumWriter() -
getChecksumDataLen
public long getChecksumDataLen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
incrBytesRead
public void incrBytesRead(boolean local, long delta) -
incrBytesWritten
public void incrBytesWritten(long delta) -
getBytesRead
public long getBytesRead() -
getRemoteBytesRead
public long getRemoteBytesRead() -
getBytesWritten
public long getBytesWritten() -
initDecoderIfNecessary
protected void initDecoderIfNecessary() -
initDecodingValidatorIfNecessary
protected void initDecodingValidatorIfNecessary() -
getChecksum
public org.apache.hadoop.util.DataChecksum getChecksum() -
getErasureCodingWorker
-
markBuffers
-
resetBuffers
-