org.apache.hadoop.hive.common
Interface ValidTxnList

All Known Implementing Classes:
ValidTxnListImpl

public interface ValidTxnList

Models the list of transactions that should be included in a snapshot. It is modelled as a high water mark, which is the largest transaction id that has been committed and a list of transactions that are not included.


Nested Class Summary
static class ValidTxnList.RangeResponse
          The response to a range query.
 
Field Summary
static String VALID_TXNS_KEY
          Key used to store valid txn list in a Configuration object.
 
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 writeToString()
          Write this validTxnList into a string.
 

Field Detail

VALID_TXNS_KEY

static final String VALID_TXNS_KEY
Key used to store valid txn list in a Configuration object.

See Also:
Constant Field Values
Method Detail

isTxnCommitted

boolean isTxnCommitted(long txnid)
Indicates whether a given transaction has been committed and should be viewed as valid for read.

Parameters:
txnid - id for the transaction
Returns:
true if committed, false otherwise

isTxnRangeCommitted

ValidTxnList.RangeResponse isTxnRangeCommitted(long minTxnId,
                                               long maxTxnId)
Find out if a range of transaction ids have been committed.

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.

writeToString

String writeToString()
Write this validTxnList into a string. This should produce a string that can be used by readFromString(String) to populate a validTxnsList.


readFromString

void readFromString(String src)
Populate this validTxnList from the string. It is assumed that the string was created via writeToString().

Parameters:
src - source string.

getHighWatermark

long getHighWatermark()
Get the largest committed transaction id.

Returns:
largest committed transaction id

getOpenTransactions

long[] getOpenTransactions()
Get the list of transactions under the high water mark that are still open.

Returns:
a list of open transaction ids


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