org.apache.hadoop.hbase
Class HMemcache

java.lang.Object
  extended by org.apache.hadoop.hbase.HMemcache

public class HMemcache
extends Object

The HMemcache holds in-memory modifications to the HRegion. This is really a wrapper around a TreeMap that helps us when staging the Memcache out to disk.


Constructor Summary
HMemcache()
          Constructor
 
Method Summary
 void add(Text row, TreeMap<Text,byte[]> columns, long timestamp)
          Store a value.
 void deleteSnapshot()
          Delete the snapshot, remove from history.
 byte[][] get(HStoreKey key, int numVersions)
          Look back through all the backlog TreeMaps to find the target.
 TreeMap<Text,byte[]> getFull(HStoreKey key)
          Return all the available columns for the given key.
 long getSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HMemcache

public HMemcache()
Constructor

Method Detail

deleteSnapshot

public void deleteSnapshot()
                    throws IOException
Delete the snapshot, remove from history. Modifying the structure means we need to obtain a writelock.

Throws:
IOException

add

public void add(Text row,
                TreeMap<Text,byte[]> columns,
                long timestamp)
Store a value. Operation uses a write lock.

Parameters:
row -
columns -
timestamp -

getSize

public long getSize()
Returns:
Approximate size in bytes of payload carried by this memcache. Does not take into consideration deletes nor adding again on same key.

get

public byte[][] get(HStoreKey key,
                    int numVersions)
Look back through all the backlog TreeMaps to find the target.

Parameters:
key -
numVersions -
Returns:
An array of byte arrays ordered by timestamp.

getFull

public TreeMap<Text,byte[]> getFull(HStoreKey key)
Return all the available columns for the given key. The key indicates a row and timestamp, but not a column name. The returned object should map column names to byte arrays (byte[]).

Parameters:
key -
Returns:
All columns for given key.


Copyright © 2006 The Apache Software Foundation