org.apache.hadoop.hbase.io.hfile
Class BlockCacheKey
java.lang.Object
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
BlockCacheKey
public BlockCacheKey(String file,
long offset,
DataBlockEncoding encoding,
BlockType blockType)
BlockCacheKey
public BlockCacheKey(String file,
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
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
getHfileName
public String getHfileName()
- Returns:
- The hfileName portion of this cache key
getDataBlockEncoding
public DataBlockEncoding getDataBlockEncoding()
getOffset
public long getOffset()
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.