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.RangeResponseexceptions, highWatermarkVALID_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, toStringpublic 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)
ValidTxnListisTxnRangeValid in interface ValidTxnListisTxnRangeValid in class ValidReadTxnListminTxnId - minimum txnid to look for, inclusivemaxTxnId - maximum txnid to look for, inclusivepublic String writeToString()
ValidTxnListValidTxnList.readFromString(String) to populate a validTxnsList.writeToString in interface ValidTxnListwriteToString in class ValidReadTxnListpublic void readFromString(String src)
ValidTxnListValidTxnList.writeToString().readFromString in interface ValidTxnListreadFromString in class ValidReadTxnListsrc - source string.Copyright © 2017 The Apache Software Foundation. All rights reserved.