Package org.apache.hadoop.hbase.io.hfile
Class TestChecksum
java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestChecksum
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classThis class is to test checksum behavior when data is corrupted. - 
Field Summary
FieldsModifier 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.FileSystemprivate org.apache.hadoop.hbase.fs.HFileSystemprivate static final org.slf4j.Loggerprivate static final HBaseTestingUtil - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.nio.ByteBuffgetBufferWithChecksum(org.apache.hadoop.hbase.io.hfile.HFileBlock block) HFileBlock buffer does not include checksum because it is discarded after verifying upon reading from disk.voidsetUp()voidTest different values of bytesPerChecksumvoidIntroduce checksum failures and check that we can still read the dataprotected voidtestChecksumCorruptionInternals(boolean useTags) protected voidtestChecksumInternals(boolean useTags) voidvoidprivate voidprivate voidverifyMBBCheckSum(org.apache.hadoop.hbase.nio.ByteBuff buf) private voidverifySBBCheckSum(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
 
 -