public class TransactionSnapshot extends Object implements TransactionVisibilityState
| Constructor and Description |
|---|
TransactionSnapshot(long timestamp,
long readPointer,
long writePointer,
Collection<Long> invalid,
NavigableMap<Long,TransactionManager.InProgressTx> inProgress)
Creates an instance of TransactionSnapshot with the given transaction state
|
TransactionSnapshot(long timestamp,
long readPointer,
long writePointer,
Collection<Long> invalid,
NavigableMap<Long,TransactionManager.InProgressTx> inProgress,
Map<Long,Set<ChangeId>> committing,
Map<Long,Set<ChangeId>> committed)
Creates an instance of TransactionSnapshot with the given transaction state
|
| Modifier and Type | Method and Description |
|---|---|
static TransactionSnapshot |
copyFrom(long snapshotTime,
long readPointer,
long writePointer,
InvalidTxList invalidTxList,
NavigableMap<Long,TransactionManager.InProgressTx> inProgress,
Map<Long,TransactionManager.ChangeSet> committing,
NavigableMap<Long,TransactionManager.ChangeSet> committed)
Creates a new
TransactionSnapshot instance with copies of all of the individual collections. |
boolean |
equals(Object obj)
Checks that this instance matches another
TransactionSnapshot instance. |
Map<Long,Set<ChangeId>> |
getCommittedChangeSets()
Returns a map of transaction write pointer to set of changed row keys for transaction that had successfully called
InMemoryTransactionManager.commit(Transaction) at the time of the snapshot. |
Map<Long,Set<ChangeId>> |
getCommittingChangeSets()
Returns a map of transaction write pointer to sets of changed row keys for transactions that had called
InMemoryTransactionManager.canCommit(Transaction, Collection) but not yet called
InMemoryTransactionManager.commit(Transaction) at the time of the snapshot. |
NavigableMap<Long,TransactionManager.InProgressTx> |
getInProgress()
Returns the map of write pointers to in-progress transactions at the time of the snapshot.
|
Collection<Long> |
getInvalid()
Returns the list of invalid write pointers at the time of the snapshot.
|
long |
getReadPointer()
Returns the read pointer at the time of the snapshot.
|
long |
getTimestamp()
Returns the timestamp from when this snapshot was created.
|
long |
getVisibilityUpperBound() |
long |
getWritePointer()
Returns the next write pointer at the time of the snapshot.
|
int |
hashCode() |
String |
toString() |
public TransactionSnapshot(long timestamp,
long readPointer,
long writePointer,
Collection<Long> invalid,
NavigableMap<Long,TransactionManager.InProgressTx> inProgress,
Map<Long,Set<ChangeId>> committing,
Map<Long,Set<ChangeId>> committed)
timestamp - timestamp, in millis, that the snapshot was takenreadPointer - current transaction read pointerwritePointer - current transaction write pointerinvalid - current list of invalid write pointer; must be sortedinProgress - current map of in-progress write pointers to expiration timestampscommitting - current map of write pointers to change sets which have passed canCommit() but not
yet committedcommitted - current map of write pointers to change sets which have committedpublic TransactionSnapshot(long timestamp,
long readPointer,
long writePointer,
Collection<Long> invalid,
NavigableMap<Long,TransactionManager.InProgressTx> inProgress)
timestamp - timestamp, in millis, that the snapshot was takenreadPointer - current transaction read pointerwritePointer - current transaction write pointerinvalid - current list of invalid write pointer; must be sortedinProgress - current map of in-progress write pointers to expiration timestampspublic long getTimestamp()
TransactionVisibilityStategetTimestamp in interface TransactionVisibilityStatepublic long getReadPointer()
TransactionVisibilityStategetReadPointer in interface TransactionVisibilityStatepublic long getWritePointer()
TransactionVisibilityStategetWritePointer in interface TransactionVisibilityStatepublic Collection<Long> getInvalid()
TransactionVisibilityStategetInvalid in interface TransactionVisibilityStatepublic NavigableMap<Long,TransactionManager.InProgressTx> getInProgress()
TransactionVisibilityStategetInProgress in interface TransactionVisibilityStatepublic long getVisibilityUpperBound()
getVisibilityUpperBound in interface TransactionVisibilityStateX such that any of the transactions newer than X might be invisible to
some of the currently in-progress transactions or to those that will be started NOTE: the returned tx id can be invalid.
public Map<Long,Set<ChangeId>> getCommittingChangeSets()
InMemoryTransactionManager.canCommit(Transaction, Collection) but not yet called
InMemoryTransactionManager.commit(Transaction) at the time of the snapshot.public Map<Long,Set<ChangeId>> getCommittedChangeSets()
InMemoryTransactionManager.commit(Transaction) at the time of the snapshot.public boolean equals(Object obj)
TransactionSnapshot instance. Note that the equality check
ignores the snapshot timestamp value, but includes all other properties.public static TransactionSnapshot copyFrom(long snapshotTime, long readPointer, long writePointer, InvalidTxList invalidTxList, NavigableMap<Long,TransactionManager.InProgressTx> inProgress, Map<Long,TransactionManager.ChangeSet> committing, NavigableMap<Long,TransactionManager.ChangeSet> committed)
TransactionSnapshot instance with copies of all of the individual collections.snapshotTime - timestamp, in millis, that the snapshot was takenreadPointer - current transaction read pointerwritePointer - current transaction write pointerinvalidTxList - current list of invalid write pointersinProgress - current map of in-progress write pointers to expiration timestampscommitting - current map of write pointers to change sets which have passed canCommit() but not
yet committedcommitted - current map of write pointers to change sets which have committedTransactionSnapshot instanceCopyright © 2017 The Apache Software Foundation. All rights reserved.