org.apache.hadoop.hbase.regionserver
Class MultiVersionConsistencyControl

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.MultiVersionConsistencyControl

public class MultiVersionConsistencyControl
extends Object

Manages the read/write consistency within memstore. This provides an interface for readers to determine what entries to ignore, and a mechanism for writers to obtain new write numbers, then "commit" the new writes for readers to read (thus forming atomic transactions).


Nested Class Summary
static class MultiVersionConsistencyControl.WriteEntry
           
 
Field Summary
static long FIXED_SIZE
           
 
Constructor Summary
MultiVersionConsistencyControl()
          Default constructor.
 
Method Summary
 MultiVersionConsistencyControl.WriteEntry beginMemstoreInsert()
           
 void completeMemstoreInsert(MultiVersionConsistencyControl.WriteEntry e)
           
static long getThreadReadPoint()
          Get this thread's read point.
 void initialize(long startPoint)
          Initializes the memstoreRead/Write points appropriately.
 long memstoreReadPoint()
           
static void resetThreadReadPoint()
          Set the thread MVCC read point to 0 (include everything).
static long resetThreadReadPoint(MultiVersionConsistencyControl mvcc)
          Set the thread MVCC read point to whatever the current read point is in this particular instance of MVCC.
static void setThreadReadPoint(long readPoint)
          Set the thread read point to the given value.
 void waitForRead(MultiVersionConsistencyControl.WriteEntry e)
          Wait for the global readPoint to advance upto the specified transaction number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIXED_SIZE

public static final long FIXED_SIZE
Constructor Detail

MultiVersionConsistencyControl

public MultiVersionConsistencyControl()
Default constructor. Initializes the memstoreRead/Write points to 0.

Method Detail

initialize

public void initialize(long startPoint)
Initializes the memstoreRead/Write points appropriately.

Parameters:
startPoint -

getThreadReadPoint

public static long getThreadReadPoint()
Get this thread's read point. Used primarily by the memstore scanner to know which values to skip (ie: have not been completed/committed to memstore).


setThreadReadPoint

public static void setThreadReadPoint(long readPoint)
Set the thread read point to the given value. The thread MVCC is used by the Memstore scanner so it knows which values to skip. Give it a value of 0 if you want everything.


resetThreadReadPoint

public static long resetThreadReadPoint(MultiVersionConsistencyControl mvcc)
Set the thread MVCC read point to whatever the current read point is in this particular instance of MVCC. Returns the new thread read point value.


resetThreadReadPoint

public static void resetThreadReadPoint()
Set the thread MVCC read point to 0 (include everything).


beginMemstoreInsert

public MultiVersionConsistencyControl.WriteEntry beginMemstoreInsert()

completeMemstoreInsert

public void completeMemstoreInsert(MultiVersionConsistencyControl.WriteEntry e)

waitForRead

public void waitForRead(MultiVersionConsistencyControl.WriteEntry e)
Wait for the global readPoint to advance upto the specified transaction number.


memstoreReadPoint

public long memstoreReadPoint()


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.