org.apache.hadoop.hive.common
Class ValidTxnListImpl

java.lang.Object
  extended by org.apache.hadoop.hive.common.ValidTxnListImpl
All Implemented Interfaces:
ValidTxnList

public class ValidTxnListImpl
extends Object
implements ValidTxnList


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.common.ValidTxnList
ValidTxnList.RangeResponse
 
Field Summary
 
Fields inherited from interface org.apache.hadoop.hive.common.ValidTxnList
VALID_TXNS_KEY
 
Constructor Summary
ValidTxnListImpl()
           
ValidTxnListImpl(long[] exceptions, long highWatermark)
           
ValidTxnListImpl(String value)
           
 
Method Summary
 long getHighWatermark()
          Get the largest committed transaction id.
 long[] getOpenTransactions()
          Get the list of transactions under the high water mark that are still open.
 boolean isTxnCommitted(long txnid)
          Indicates whether a given transaction has been committed and should be viewed as valid for read.
 ValidTxnList.RangeResponse isTxnRangeCommitted(long minTxnId, long maxTxnId)
          Find out if a range of transaction ids have been committed.
 void readFromString(String src)
          Populate this validTxnList from the string.
 String toString()
           
 String writeToString()
          Write this validTxnList into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidTxnListImpl

public ValidTxnListImpl()

ValidTxnListImpl

public ValidTxnListImpl(long[] exceptions,
                        long highWatermark)

ValidTxnListImpl

public ValidTxnListImpl(String value)
Method Detail

isTxnCommitted

public boolean isTxnCommitted(long txnid)
Description copied from interface: ValidTxnList
Indicates whether a given transaction has been committed and should be viewed as valid for read.

Specified by:
isTxnCommitted in interface ValidTxnList
Parameters:
txnid - id for the transaction
Returns:
true if committed, false otherwise

isTxnRangeCommitted

public ValidTxnList.RangeResponse isTxnRangeCommitted(long minTxnId,
                                                      long maxTxnId)
Description copied from interface: ValidTxnList
Find out if a range of transaction ids have been committed.

Specified by:
isTxnRangeCommitted in interface ValidTxnList
Parameters:
minTxnId - minimum txnid to look for, inclusive
maxTxnId - maximum txnid to look for, inclusive
Returns:
Indicate whether none, some, or all of these transactions have been committed.

toString

public String toString()
Overrides:
toString in class Object

writeToString

public String writeToString()
Description copied from interface: ValidTxnList
Write this validTxnList into a string. This should produce a string that can be used by ValidTxnList.readFromString(String) to populate a validTxnsList.

Specified by:
writeToString in interface ValidTxnList

readFromString

public void readFromString(String src)
Description copied from interface: ValidTxnList
Populate this validTxnList from the string. It is assumed that the string was created via ValidTxnList.writeToString().

Specified by:
readFromString in interface ValidTxnList
Parameters:
src - source string.

getHighWatermark

public long getHighWatermark()
Description copied from interface: ValidTxnList
Get the largest committed transaction id.

Specified by:
getHighWatermark in interface ValidTxnList
Returns:
largest committed transaction id

getOpenTransactions

public long[] getOpenTransactions()
Description copied from interface: ValidTxnList
Get the list of transactions under the high water mark that are still open.

Specified by:
getOpenTransactions in interface ValidTxnList
Returns:
a list of open transaction ids


Copyright © 2014 The Apache Software Foundation. All rights reserved.