public class ValidReadTxnList extends Object implements ValidTxnList
ValidTxnList
for use by readers.
This class will view a transaction as valid only if it is committed. Both open and aborted
transactions will be seen as invalid.ValidTxnList.RangeResponse
Modifier and Type | Field and Description |
---|---|
protected BitSet |
abortedBits |
protected long[] |
exceptions |
protected long |
highWatermark |
VALID_TXNS_KEY
Constructor and Description |
---|
ValidReadTxnList() |
ValidReadTxnList(long[] exceptions,
BitSet abortedBits,
long highWatermark,
long minOpenTxn)
Used if there are no open transactions in the snapshot
|
ValidReadTxnList(String value) |
Modifier and Type | Method and Description |
---|---|
long |
getHighWatermark()
Get the largest transaction id used.
|
long[] |
getInvalidTransactions()
Get the list of transactions under the high water mark that are not valid.
|
Long |
getMinOpenTxn()
Returns smallest Open transaction in this set,
null if there is none. |
boolean |
isTxnAborted(long txnid)
Indicates whether a given transaction is aborted.
|
ValidTxnList.RangeResponse |
isTxnRangeAborted(long minTxnId,
long maxTxnId)
Find out if a range of transaction ids are aborted.
|
ValidTxnList.RangeResponse |
isTxnRangeValid(long minTxnId,
long maxTxnId)
Find out if a range of transaction ids are valid.
|
boolean |
isTxnValid(long txnid)
Indicates whether a given transaction is valid.
|
void |
readFromString(String src)
Populate this validTxnList from the string.
|
void |
removeException(long txnId) |
String |
toString() |
String |
writeToString()
Write this validTxnList into a string.
|
protected long[] exceptions
protected BitSet abortedBits
protected long highWatermark
public ValidReadTxnList()
public ValidReadTxnList(long[] exceptions, BitSet abortedBits, long highWatermark, long minOpenTxn)
public ValidReadTxnList(String value)
public void removeException(long txnId)
removeException
in interface ValidTxnList
public boolean isTxnValid(long txnid)
ValidTxnList
isTxnValid
in interface ValidTxnList
txnid
- id for the transactionpublic ValidTxnList.RangeResponse isTxnRangeValid(long minTxnId, long maxTxnId)
ValidTxnList
isTxnRangeValid
in interface ValidTxnList
minTxnId
- minimum txnid to look for, inclusivemaxTxnId
- maximum txnid to look for, inclusivepublic String writeToString()
ValidTxnList
ValidTxnList.readFromString(String)
to populate a validTxnsList.writeToString
in interface ValidTxnList
public void readFromString(String src)
ValidTxnList
ValidTxnList.writeToString()
and the exceptions list is sorted.readFromString
in interface ValidTxnList
src
- source string.public long getHighWatermark()
ValidTxnList
getHighWatermark
in interface ValidTxnList
public long[] getInvalidTransactions()
ValidTxnList
getInvalidTransactions
in interface ValidTxnList
public Long getMinOpenTxn()
ValidTxnList
null
if there is none.getMinOpenTxn
in interface ValidTxnList
public boolean isTxnAborted(long txnid)
ValidTxnList
isTxnAborted
in interface ValidTxnList
txnid
- id for the transactionpublic ValidTxnList.RangeResponse isTxnRangeAborted(long minTxnId, long maxTxnId)
ValidTxnList
isTxnRangeAborted
in interface ValidTxnList
minTxnId
- minimum txnid to look for, inclusivemaxTxnId
- maximum txnid to look for, inclusiveCopyright © 2021 The Apache Software Foundation. All rights reserved.