public class TransactionSnapshot extends Object
| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
static TransactionSnapshot |
copyFrom(long snapshotTime,
long readPointer,
long writePointer,
Collection<Long> invalid,
NavigableMap<Long,TransactionManager.InProgressTx> inProgress,
Map<Long,Set<ChangeId>> committing,
NavigableMap<Long,Set<ChangeId>> 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. |
Map<Long,TransactionManager.InProgressTx> |
getInProgress()
Returns the map of in-progress transaction write pointers 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)
public long getTimestamp()
public long getReadPointer()
public long getWritePointer()
public Collection<Long> getInvalid()
public Map<Long,TransactionManager.InProgressTx> getInProgress()
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 long getVisibilityUpperBound()
X 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 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, Collection<Long> invalid, NavigableMap<Long,TransactionManager.InProgressTx> inProgress, Map<Long,Set<ChangeId>> committing, NavigableMap<Long,Set<ChangeId>> committed)
TransactionSnapshot instance with copies of all of the individual collections.readPointer - current transaction read pointerwritePointer - current transaction write pointerinvalid - 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 © 2015. All Rights Reserved.