Class HFileBlockIndex

java.lang.Object
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex

@Private public class HFileBlockIndex extends Object
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.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • DEFAULT_MAX_CHUNK_SIZE

      static final int DEFAULT_MAX_CHUNK_SIZE
      See Also:
    • MAX_CHUNK_SIZE_KEY

      public static final String 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

      public static final String 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

      private static final String INLINE_BLOCKS_NOT_ALLOWED
      Error message when trying to use inline block API in single-level mode.
      See Also:
    • MID_KEY_METADATA_SIZE

      protected static final int 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

  • Method Details

    • getMaxChunkSize

      public static int getMaxChunkSize(org.apache.hadoop.conf.Configuration conf)
    • getMinIndexNumEntries

      public static int getMinIndexNumEntries(org.apache.hadoop.conf.Configuration conf)