public class SnapshotTransactionalContext extends AbstractTransactionalContext
Given the snapshot (log address) given by the TransactionBuilder, access all objects within the same snapshot during the course of this transactional context.
Created by mwei on 11/22/16.
ABORTED_ADDRESS, commitAddress, completionFuture, FOLDED_ADDRESS, NOWRITE_ADDRESS, startTime, transaction, transactionID, UNCOMMITTED_ADDRESS
Constructor and Description |
---|
SnapshotTransactionalContext(Transaction transaction) |
Modifier and Type | Method and Description |
---|---|
<R,T> R |
access(ICorfuSMRProxyInternal<T> proxy,
ICorfuSMRAccess<R,T> accessFunction,
Object[] conflictObject)
Access the state of the object.
|
void |
addTransaction(AbstractTransactionalContext tc)
Add a given transaction to this transactional context, merging
the read and write sets.
|
<T> Object |
getUpcallResult(ICorfuSMRProxyInternal<T> proxy,
long timestamp,
Object[] conflictObject)
Get the result of an upcall.
|
<T> long |
logUpdate(ICorfuSMRProxyInternal<T> proxy,
SMREntry updateEntry,
Object[] conflictObject)
Log an SMR update to the Corfu log.
|
abortTransaction, addToReadSet, commitTransaction, compareTo, syncWithRetryUnsafe, toString
public SnapshotTransactionalContext(Transaction transaction)
public <R,T> R access(ICorfuSMRProxyInternal<T> proxy, ICorfuSMRAccess<R,T> accessFunction, Object[] conflictObject)
access
in class AbstractTransactionalContext
R
- The return type of the access function.T
- The type of the proxy's underlying object.proxy
- The proxy to access the state for.accessFunction
- The function to execute, which will be provided with the state
of the object.conflictObject
- Fine-grained conflict information, if available.public <T> Object getUpcallResult(ICorfuSMRProxyInternal<T> proxy, long timestamp, Object[] conflictObject)
getUpcallResult
in class AbstractTransactionalContext
T
- The type of the proxy's underlying object.proxy
- The proxy to retrieve the upcall for.timestamp
- The timestamp to return the upcall for.conflictObject
- Fine-grained conflict information, if available.public <T> long logUpdate(ICorfuSMRProxyInternal<T> proxy, SMREntry updateEntry, Object[] conflictObject)
logUpdate
in class AbstractTransactionalContext
T
- The type of the proxy's underlying object.proxy
- The proxy which generated the update.updateEntry
- The entry which we are writing to the log.conflictObject
- Fine-grained conflict information, if available.public void addTransaction(AbstractTransactionalContext tc)
AbstractTransactionalContext
addTransaction
in class AbstractTransactionalContext
tc
- The transactional context to merge.Copyright © 2019 CorfuDB. All rights reserved.