Class BlockCacheKey

java.lang.Object
org.apache.hadoop.hbase.io.hfile.BlockCacheKey
All Implemented Interfaces:
Serializable, HeapSize

@Private public class BlockCacheKey extends Object implements HeapSize, Serializable
Cache Key for use with implementations of BlockCache
See Also:
  • Field Details

  • Constructor Details

    • BlockCacheKey

      public BlockCacheKey(String hfileName, long offset)
      Constructs a new BlockCacheKey with the file name and offset only. To be used for cache lookups only, DO NOT use this for creating keys when inserting into the cache. Use either the overriding constructors with the path parameter or the region and cf parameters, otherwise, region cache metrics won't be recorded properly.
      Parameters:
      hfileName - The name of the HFile this block belongs to.
      offset - Offset of the block into the file
    • BlockCacheKey

      public BlockCacheKey(String hfileName, long offset, boolean isPrimaryReplica, BlockType blockType)
      Constructs a new BlockCacheKey with the file name, offset, replica and type only. To be used for cache lookups only, DO NOT use this for creating keys when inserting into the cache. Use either the overriding constructors with the path parameter or the region and cf parameters, otherwise, region cache metrics won't be recorded properly.
      Parameters:
      hfileName - The name of the HFile this block belongs to.
      offset - Offset of the block into the file
      isPrimaryReplica - Whether this is from primary replica
      blockType - Type of block
    • BlockCacheKey

      public BlockCacheKey(String hfileName, String cfName, String regionName, long offset, boolean isPrimaryReplica, BlockType blockType, boolean archived)
      Construct a new BlockCacheKey, with file, column family and region information. This should be used when inserting keys into the cache, so that region cache metrics are recorded properly.
      Parameters:
      hfileName - The name of the HFile this block belongs to.
      cfName - The column family name
      regionName - The region name
      offset - Offset of the block into the file
      isPrimaryReplica - Whether this is from primary replica
      blockType - Type of block
    • BlockCacheKey

      public BlockCacheKey(org.apache.hadoop.fs.Path hfilePath, long offset, boolean isPrimaryReplica, BlockType blockType)
      Construct a new BlockCacheKey using a file path. File, column family and region information will be extracted from the passed path. This should be used when inserting keys into the cache, so that region cache metrics are recorded properly.
      Parameters:
      hfilePath - The path to the HFile
      offset - Offset of the block into the file
      isPrimaryReplica - Whether this is from primary replica
      blockType - Type of block
  • Method Details