public class TxUtils extends Object
Constructor and Description |
---|
TxUtils() |
Modifier and Type | Method and Description |
---|---|
static Transaction |
createDummyTransaction(TransactionVisibilityState txVisibilityState)
Creates a "dummy" transaction based on the given txVisibilityState's state.
|
static long |
getFirstShortInProgress(Map<Long,TransactionManager.InProgressTx> inProgress)
Returns the write pointer for the first "short" transaction that in the in-progress set, or
Transaction.NO_TX_IN_PROGRESS if none. |
static long |
getMaxVisibleTimestamp(Transaction tx)
Returns the maximum timestamp to use for time-range operations, based on the given transaction.
|
static long |
getOldestVisibleTimestamp(Map<byte[],Long> ttlByFamily,
Transaction tx)
Returns the oldest visible timestamp for the given transaction, based on the TTLs configured for each column
family.
|
static long |
getOldestVisibleTimestamp(Map<byte[],Long> ttlByFamily,
Transaction tx,
boolean readNonTxnData)
Returns the oldest visible timestamp for the given transaction, based on the TTLs configured for each column
family.
|
static long |
getTimestampForTTL(long cellTs)
Returns the timestamp for calculating time to live for the given cell timestamp.
|
static boolean |
isPreExistingVersion(long version)
Returns true if version was written before table was converted into transactional table, false otherwise.
|
public static long getOldestVisibleTimestamp(Map<byte[],Long> ttlByFamily, Transaction tx)
0
.ttlByFamily
- A map of column family name to TTL value (in milliseconds)tx
- The current transactionpublic static long getOldestVisibleTimestamp(Map<byte[],Long> ttlByFamily, Transaction tx, boolean readNonTxnData)
0
.ttlByFamily
- A map of column family name to TTL value (in milliseconds)tx
- The current transactionreadNonTxnData
- indicates that the timestamp returned should allow reading non-transactional datapublic static long getMaxVisibleTimestamp(Transaction tx)
tx
- The current transactionpublic static Transaction createDummyTransaction(TransactionVisibilityState txVisibilityState)
Long.MAX_VALUE
to avoid mis-identifying any cells
as being written by this transaction (and therefore visible).public static long getFirstShortInProgress(Map<Long,TransactionManager.InProgressTx> inProgress)
Transaction.NO_TX_IN_PROGRESS
if none.public static long getTimestampForTTL(long cellTs)
public static boolean isPreExistingVersion(long version)
Copyright © 2016 The Apache Software Foundation. All rights reserved.