org.apache.hadoop.hbase.regionserver
Class MultiVersionConsistencyControl

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

@InterfaceAudience.Private
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()
          Generate and return a MultiVersionConsistencyControl.WriteEntry with a new write number.
 void completeMemstoreInsert(MultiVersionConsistencyControl.WriteEntry e)
          Complete a MultiVersionConsistencyControl.WriteEntry that was created by beginMemstoreInsert().
 void initialize(long startPoint)
          Initializes the memstoreRead/Write points appropriately.
 long memstoreReadPoint()
           
 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 -

beginMemstoreInsert

public MultiVersionConsistencyControl.WriteEntry beginMemstoreInsert()
Generate and return a MultiVersionConsistencyControl.WriteEntry with a new write number. To complete the WriteEntry and wait for it to be visible, call completeMemstoreInsert(WriteEntry).


completeMemstoreInsert

public void completeMemstoreInsert(MultiVersionConsistencyControl.WriteEntry e)
Complete a MultiVersionConsistencyControl.WriteEntry that was created by beginMemstoreInsert(). At the end of this call, the global read point is at least as large as the write point of the passed in WriteEntry. Thus, the write is visible to MVCC readers.


waitForRead

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


memstoreReadPoint

public long memstoreReadPoint()


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