Package org.apache.hadoop.hbase.io.hfile
Class TestChecksum
java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestChecksum
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
This class is to test checksum behavior when data is corrupted. -
Field Summary
Modifier and TypeFieldDescription(package private) static final int[]
static final HBaseClassTestRule
(package private) static final org.apache.hadoop.hbase.io.compress.Compression.Algorithm[]
private org.apache.hadoop.fs.FileSystem
private org.apache.hadoop.hbase.fs.HFileSystem
private static final org.slf4j.Logger
private static final HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.nio.ByteBuff
getBufferWithChecksum
(org.apache.hadoop.hbase.io.hfile.HFileBlock block) HFileBlock buffer does not include checksum because it is discarded after verifying upon reading from disk.void
setUp()
void
Test different values of bytesPerChecksumvoid
Introduce checksum failures and check that we can still read the dataprotected void
testChecksumCorruptionInternals
(boolean useTags) protected void
testChecksumInternals
(boolean useTags) void
void
private void
private void
verifyMBBCheckSum
(org.apache.hadoop.hbase.nio.ByteBuff buf) private void
verifySBBCheckSum
(org.apache.hadoop.hbase.nio.ByteBuff buf)
-
Field Details
-
CLASS_RULE
-
LOG
-
COMPRESSION_ALGORITHMS
-
BYTES_PER_CHECKSUM
-
TEST_UTIL
-
fs
-
hfs
-
-
Constructor Details
-
TestChecksum
public TestChecksum()
-
-
Method Details
-
setUp
- Throws:
Exception
-
testNewBlocksHaveDefaultChecksum
- Throws:
IOException
-
verifyMBBCheckSum
- Throws:
IOException
-
verifySBBCheckSum
- Throws:
IOException
-
testVerifyCheckSum
- Throws:
IOException
-
getBufferWithChecksum
private org.apache.hadoop.hbase.nio.ByteBuff getBufferWithChecksum(org.apache.hadoop.hbase.io.hfile.HFileBlock block) throws IOException HFileBlock buffer does not include checksum because it is discarded after verifying upon reading from disk. We artificially add a checksum onto the buffer for use in testing that ChecksumUtil.validateChecksum works for SingleByteBuff and MultiByteBuff inverifySBBCheckSum(ByteBuff)
andverifyMBBCheckSum(ByteBuff)
- Throws:
IOException
-
testChecksumCorruption
Introduce checksum failures and check that we can still read the data- Throws:
IOException
-
testChecksumCorruptionInternals
- Throws:
IOException
-
testChecksumChunks
Test different values of bytesPerChecksum- Throws:
IOException
-
testChecksumInternals
- Throws:
IOException
-
validateData
- Throws:
IOException
-