public class ValidCompactorTxnList extends ValidReadTxnList
ValidTxnList
for use by the compactor.
Compaction should only include txns up to smallest open txn (exclussive).
There may be aborted txns in the snapshot represented by this ValidCompactorTxnList.
Thus isTxnRangeValid(long, long)
returns NONE for any range that inluces any unresolved
transactions. Any txn above highWatermark
is unresolved.
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.
See org.apache.hadoop.hive.metastore.txn.TxnUtils#createValidCompactTxnList()
for proper
way to construct this.ValidTxnList.RangeResponse
exceptions, highWatermark
VALID_TXNS_KEY
Constructor and Description |
---|
ValidCompactorTxnList() |
ValidCompactorTxnList(long[] abortedTxnList,
long highWatermark) |
ValidCompactorTxnList(String value) |
Modifier and Type | Method and Description |
---|---|
ValidTxnList.RangeResponse |
isTxnRangeValid(long minTxnId,
long maxTxnId)
Returns
org.apache.hadoop.hive.common.ValidTxnList.RangeResponse.ALL if all txns in
the range are resolved and RangeResponse.NONE otherwise |
getHighWatermark, getInvalidTransactions, getMinOpenTxn, isTxnValid, isValidBase, readFromString, toString, writeToString
public ValidCompactorTxnList()
public ValidCompactorTxnList(long[] abortedTxnList, long highWatermark)
abortedTxnList
- list of all aborted transactionshighWatermark
- highest committed transaction to be considered for compaction,
equivalently (lowest_open_txn - 1).public ValidCompactorTxnList(String value)
public ValidTxnList.RangeResponse isTxnRangeValid(long minTxnId, long maxTxnId)
org.apache.hadoop.hive.common.ValidTxnList.RangeResponse.ALL
if all txns in
the range are resolved and RangeResponse.NONE otherwiseisTxnRangeValid
in interface ValidTxnList
isTxnRangeValid
in class ValidReadTxnList
minTxnId
- minimum txnid to look for, inclusivemaxTxnId
- maximum txnid to look for, inclusiveCopyright © 2021 The Apache Software Foundation. All rights reserved.