Package org.apache.hadoop.hbase.io.hfile
Class TestHFileBlockHeaderCorruption
java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestHFileBlockHeaderCorruption
@Tag("org.apache.hadoop.hbase.testclassification.IOTests") @Tag("org.apache.hadoop.hbase.testclassification.SmallTests")
public class TestHFileBlockHeaderCorruption
extends Object
This test provides coverage for HFileHeader block fields that are read and interpreted before
HBase checksum validation can be applied. As of now, this is just
onDiskSizeWithoutHeader.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnables writing and rewriting portions of the file backing anHFileBlock.static classReads blocks off of anTestHFileBlockHeaderCorruption.HFileBlockChannelPositionIterator, counting them as it does.static classData class to enabled messing with the bytes behind anHFileBlock.static classA simplified wrapper over anHFileBlock.BlockIteratorthat looks a lot like anIterator.private static final classA Matcher implementation that can make basic assertions over a providedThrowable. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprivate static voidlogHeader(org.apache.hadoop.hbase.nio.ByteBuff buf) voidsetUp(org.junit.jupiter.api.TestInfo testInfo) static voidvoidvoidvoidvoidvoidtestValidChecksumTypeReadBlock(byte checksumTypeCode, TestHFileBlockHeaderCorruption.Corrupter c, TestHFileBlockHeaderCorruption.HFileBlockChannelPosition testBlock)
-
Field Details
-
LOG
-
UTIL
-
HFS
-
hfileCtx
-
path
-
-
Constructor Details
-
TestHFileBlockHeaderCorruption
public TestHFileBlockHeaderCorruption()
-
-
Method Details
-
setUpBeforeAll
- Throws:
IOException
-
setUp
- Throws:
IOException
-
testChecksumTypeCorruptionFirstBlock
- Throws:
Exception
-
testChecksumTypeCorruptionSecondBlock
- Throws:
Exception
-
testValidChecksumTypeReadBlock
public void testValidChecksumTypeReadBlock(byte checksumTypeCode, TestHFileBlockHeaderCorruption.Corrupter c, TestHFileBlockHeaderCorruption.HFileBlockChannelPosition testBlock) throws IOException - Throws:
IOException
-
testOnDiskSizeWithoutHeaderCorruptionFirstBlock
- Throws:
Exception
-
testOnDiskSizeWithoutHeaderCorruptionSecondBlock
- Throws:
Exception
-
logHeader
private static void logHeader(TestHFileBlockHeaderCorruption.HFileBlockChannelPosition hbcp) throws IOException - Throws:
IOException
-
logHeader
-