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

Constructor Summary
BlockCacheKey(String file, long offset)
          Construct a new BlockCacheKey
BlockCacheKey(String file, long offset, DataBlockEncoding encoding, BlockType blockType)
           
 
Method Summary
 boolean equals(Object o)
           
 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
 

Constructor Detail

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
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

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.