org.apache.hadoop.hbase.io.hfile
Class BlockCacheKey

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

@InterfaceAudience.Private
public class BlockCacheKey
extends Object
implements HeapSize, Serializable

Cache Key for use with implementations of BlockCache

See Also:
Serialized Form

Field Summary
static long FIXED_OVERHEAD
           
 
Constructor Summary
BlockCacheKey(String hfileName, long offset)
          Construct a new BlockCacheKey
BlockCacheKey(String file, long offset, DataBlockEncoding encoding, BlockType blockType)
           
 
Method Summary
 boolean equals(Object o)
           
 BlockType getBlockType()
           
 DataBlockEncoding getDataBlockEncoding()
           
 String getHfileName()
           
 long getOffset()
           
 int hashCode()
           
 long heapSize()
          Strings have two bytes per character due to default Java Unicode encoding (hence length times 2).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FIXED_OVERHEAD

public static final long FIXED_OVERHEAD
Constructor Detail

BlockCacheKey

public BlockCacheKey(String file,
                     long offset,
                     DataBlockEncoding encoding,
                     BlockType blockType)

BlockCacheKey

public BlockCacheKey(String hfileName,
                     long offset)
Construct a new BlockCacheKey

Parameters:
file - The name of the HFile this block belongs to.
offset - Offset of the block into the file
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

heapSize

public long heapSize()
Strings have two bytes per character due to default Java Unicode encoding (hence length times 2).

Specified by:
heapSize in interface HeapSize
Returns:
Approximate 'exclusive deep size' of implementing object. Includes count of payload and hosting object sizings.

getHfileName

public String getHfileName()
Returns:
The hfileName portion of this cache key

getDataBlockEncoding

public DataBlockEncoding getDataBlockEncoding()

getOffset

public long getOffset()

getBlockType

public BlockType getBlockType()


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.