Package org.apache.hadoop.hbase.io.hfile
Class TestHFileBlock
java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestHFileBlock
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hadoop.hbase.io.ByteBuffAllocatorprivate static final boolean[]private static floatstatic final HBaseClassTestRule(package private) static final org.apache.hadoop.hbase.io.compress.Compression.Algorithm[]private static final booleanprivate static intprivate org.apache.hadoop.fs.FileSystemprivate final booleanprivate final booleanprivate static final org.slf4j.Loggerprivate static final intprivate static intprivate static final intprivate static final intprivate static final Randomprivate static final HBaseTestingUtilityprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionTestHFileBlock(boolean includesMemstoreTS, boolean includesTag, boolean useHeapAllocator) -
Method Summary
Modifier and TypeMethodDescriptionprivate void(package private) static voidassertBuffersEqual(org.apache.hadoop.hbase.nio.ByteBuff expectedBuffer, org.apache.hadoop.hbase.nio.ByteBuff actualBuffer, org.apache.hadoop.hbase.io.compress.Compression.Algorithm compression, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, boolean pread) private voidassertRelease(org.apache.hadoop.hbase.io.hfile.HFileBlock blk) (package private) static StringbuildMessageDetails(org.apache.hadoop.hbase.io.compress.Compression.Algorithm compression, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, boolean pread) private org.apache.hadoop.hbase.io.ByteBuffAllocatorcreateTestBlockStr(org.apache.hadoop.hbase.io.compress.Compression.Algorithm algo, int correctLength, boolean useTag) byte[]createTestV1Block(org.apache.hadoop.hbase.io.compress.Compression.Algorithm algo) (package private) static org.apache.hadoop.hbase.io.hfile.HFileBlock.WritercreateTestV2Block(org.apache.hadoop.hbase.io.compress.Compression.Algorithm algo, boolean includesMemstoreTS, boolean includesTag) private Randomprivate static StringnextBytesToStr(org.apache.hadoop.hbase.nio.ByteBuff buf, int pos) Convert a few next bytes in the given buffer at the given position to string.static Collection<Object[]>voidsetUp()voidtearDown()voidprotected voidvoidprotected voidvoidTest encoding/decoding data blocks.voidprivate voidvoidvoidprotected voidvoidprotected voidvoidprivate longwriteBlocks(org.apache.hadoop.conf.Configuration conf, Random rand, org.apache.hadoop.hbase.io.compress.Compression.Algorithm compressAlgo, org.apache.hadoop.fs.Path path, List<Long> expectedOffsets, List<Long> expectedPrevOffsets, List<org.apache.hadoop.hbase.io.hfile.BlockType> expectedTypes, List<ByteBuffer> expectedContents) (package private) static void(package private) static intwriteTestKeyValues(org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer hbw, int seed, boolean includesMemstoreTS, boolean useTag)
-
Field Details
-
CLASS_RULE
-
detailedLogging
- See Also:
-
BOOLEAN_VALUES
-
LOG
-
COMPRESSION_ALGORITHMS
-
NUM_TEST_BLOCKS
- See Also:
-
NUM_READER_THREADS
- See Also:
-
MAX_BUFFER_COUNT
- See Also:
-
NUM_KEYVALUES
-
FIELD_LENGTH
-
CHANCE_TO_REPEAT
-
TEST_UTIL
-
RNG
-
fs
-
includesMemstoreTS
-
includesTag
-
useHeapAllocator
-
alloc
-
-
Constructor Details
-
TestHFileBlock
-
-
Method Details
-
parameters
-
createOffHeapAlloc
-
assertAllocator
-
setUp
- Throws:
IOException
-
tearDown
- Throws:
IOException
-
writeTestBlockContents
- Throws:
IOException
-
writeTestKeyValues
static int writeTestKeyValues(org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer hbw, int seed, boolean includesMemstoreTS, boolean useTag) throws IOException - Throws:
IOException
-
createTestV1Block
public byte[] createTestV1Block(org.apache.hadoop.hbase.io.compress.Compression.Algorithm algo) throws IOException - Throws:
IOException
-
createTestV2Block
static org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer createTestV2Block(org.apache.hadoop.hbase.io.compress.Compression.Algorithm algo, boolean includesMemstoreTS, boolean includesTag) throws IOException - Throws:
IOException
-
createTestBlockStr
public String createTestBlockStr(org.apache.hadoop.hbase.io.compress.Compression.Algorithm algo, int correctLength, boolean useTag) throws IOException - Throws:
IOException
-
testNoCompression
- Throws:
IOException
-
testGzipCompression
- Throws:
IOException
-
testReaderV2
- Throws:
IOException
-
assertRelease
-
testReaderV2Internals
- Throws:
IOException
-
testDataBlockEncoding
Test encoding/decoding data blocks.- Throws:
IOException- a bug or a problem with temporary files.
-
testInternals
- Throws:
IOException
-
buildMessageDetails
static String buildMessageDetails(org.apache.hadoop.hbase.io.compress.Compression.Algorithm compression, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, boolean pread) -
assertBuffersEqual
static void assertBuffersEqual(org.apache.hadoop.hbase.nio.ByteBuff expectedBuffer, org.apache.hadoop.hbase.nio.ByteBuff actualBuffer, org.apache.hadoop.hbase.io.compress.Compression.Algorithm compression, org.apache.hadoop.hbase.io.encoding.DataBlockEncoding encoding, boolean pread) -
nextBytesToStr
Convert a few next bytes in the given buffer at the given position to string. Used for error messages. -
testPreviousOffset
- Throws:
IOException
-
testPreviousOffsetInternals
- Throws:
IOException
-
defaultRandom
-
testConcurrentReading
- Throws:
Exception
-
testConcurrentReadingInternals
protected void testConcurrentReadingInternals() throws IOException, InterruptedException, ExecutionException -
writeBlocks
private long writeBlocks(org.apache.hadoop.conf.Configuration conf, Random rand, org.apache.hadoop.hbase.io.compress.Compression.Algorithm compressAlgo, org.apache.hadoop.fs.Path path, List<Long> expectedOffsets, List<Long> expectedPrevOffsets, List<org.apache.hadoop.hbase.io.hfile.BlockType> expectedTypes, List<ByteBuffer> expectedContents) throws IOException - Throws:
IOException
-
testBlockHeapSize
-
testBlockHeapSizeInternals
-
testSerializeWithoutNextBlockMetadata
-