Package org.apache.hadoop.hbase.io.hfile
Class HFileBlockIndex
java.lang.Object
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex
Provides functionality to write (
HFileBlockIndex.BlockIndexWriter
) and read BlockIndexReader single-level
and multi-level block indexes. Examples of how to use the block index writer can be found in
CompoundBloomFilterWriter
and HFileWriterImpl
.
Examples of how to use the reader can be found in HFileReaderImpl
and
org.apache.hadoop.hbase.io.hfile.TestHFileBlockIndex.-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
A single chunk of the block index in the process of writing.(package private) static class
The reader will always hold the root level index in the memory.static class
Writes the block index into the output stream.(package private) static class
An implementation of the BlockIndexReader that deals with block keys which are plain byte[] like MetaBlock or the Bloom Block for ROW bloom.(package private) static class
An implementation of the BlockIndexReader that deals with block keys which are the key part of a cell like the Data block index or the ROW_COL bloom blocks This needs a comparator to work with the Cells(package private) static class
-
Field Summary
Modifier and TypeFieldDescription(package private) static final int
(package private) static final int
private static final String
Error message when trying to use inline block API in single-level mode.private static final org.slf4j.Logger
static final String
The maximum size guideline for index blocks (both leaf, intermediate, and root).protected static final int
The size of a meta-data record used for finding the mid-key in a multi-level index.static final String
Minimum number of entries in a single index block.(package private) static final int
The number of bytes stored in each "secondary index" entry in addition to key bytes in the non-root index block format. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
getMaxChunkSize
(org.apache.hadoop.conf.Configuration conf) static int
getMinIndexNumEntries
(org.apache.hadoop.conf.Configuration conf)
-
Field Details
-
LOG
-
DEFAULT_MAX_CHUNK_SIZE
- See Also:
-
MAX_CHUNK_SIZE_KEY
The maximum size guideline for index blocks (both leaf, intermediate, and root). If not specified,DEFAULT_MAX_CHUNK_SIZE
is used.- See Also:
-
MIN_INDEX_NUM_ENTRIES_KEY
Minimum number of entries in a single index block. Even if we are above the hfile.index.block.max.size we will keep writing to the same block unless we have that many entries. We should have at least a few entries so that we don't have too many levels in the multi-level index. This should be at least 2 to make sure there is no infinite recursion.- See Also:
-
DEFAULT_MIN_INDEX_NUM_ENTRIES
- See Also:
-
SECONDARY_INDEX_ENTRY_OVERHEAD
The number of bytes stored in each "secondary index" entry in addition to key bytes in the non-root index block format. The first long is the file offset of the deeper-level block the entry points to, and the int that follows is that block's on-disk size without including header.- See Also:
-
INLINE_BLOCKS_NOT_ALLOWED
Error message when trying to use inline block API in single-level mode.- See Also:
-
MID_KEY_METADATA_SIZE
The size of a meta-data record used for finding the mid-key in a multi-level index. Consists of the middle leaf-level index block offset (long), its on-disk size without header included (int), and the mid-key entry's zero-based index in that leaf index block.- See Also:
-
-
Constructor Details
-
HFileBlockIndex
public HFileBlockIndex()
-
-
Method Details
-
getMaxChunkSize
-
getMinIndexNumEntries
-