public class ValidCompactorTxnList extends ValidReadTxnList
ValidTxnList
for use by the compactor.
For the purposes of isTxnRangeValid(long, long)
this class will view a transaction as valid if it
is committed or aborted. Additionally it will return none if there are any open transactions
below the max transaction given, since we don't want to compact above open transactions. For
ValidReadTxnList.isTxnValid(long)
it will still view a transaction as valid only if it is committed. These
produce the logic we need to assure that the compactor only sees records less than the lowest
open transaction when choosing which files to compact, but that it still ignores aborted
records when compacting.ValidTxnList.RangeResponse
exceptions, highWatermark
VALID_TXNS_KEY
Constructor and Description |
---|
ValidCompactorTxnList() |
ValidCompactorTxnList(long[] exceptions,
long minOpen,
long highWatermark) |
ValidCompactorTxnList(String value) |
Modifier and Type | Method and Description |
---|---|
ValidTxnList.RangeResponse |
isTxnRangeValid(long minTxnId,
long maxTxnId)
Find out if a range of transaction ids are valid.
|
void |
readFromString(String src)
Populate this validTxnList from the string.
|
String |
writeToString()
Write this validTxnList into a string.
|
getHighWatermark, getInvalidTransactions, isTxnValid, toString
public ValidCompactorTxnList()
public ValidCompactorTxnList(long[] exceptions, long minOpen, long highWatermark)
exceptions
- list of all open and aborted transactionsminOpen
- lowest open transactionhighWatermark
- highest committed transactionpublic ValidCompactorTxnList(String value)
public ValidTxnList.RangeResponse isTxnRangeValid(long minTxnId, long maxTxnId)
ValidTxnList
isTxnRangeValid
in interface ValidTxnList
isTxnRangeValid
in class ValidReadTxnList
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
writeToString
in class ValidReadTxnList
public void readFromString(String src)
ValidTxnList
ValidTxnList.writeToString()
.readFromString
in interface ValidTxnList
readFromString
in class ValidReadTxnList
src
- source string.Copyright © 2017 The Apache Software Foundation. All rights reserved.