Interface LockWatchValueScopingCache
-
- All Superinterfaces:
com.palantir.lock.watch.LockWatchValueCache
public interface LockWatchValueScopingCache extends com.palantir.lock.watch.LockWatchValueCache
The idea here is to keep a map ofCellReference
-> value for each table. Applying lock watch events will: - forLockEvent
, denote that the given descriptor cannot be cached; - forUnlockEvent
, denote that the given descriptor can now be cached; - forLockWatchCreatedEvent
, denote that the given table can now be cached; The central mapping is kept up-to-date with the above, but views of the map are given to transactions which are accurate at the start timestamp's lock watch version. Each transaction then can read from the cache as well as create a digest of values that it has read (and is allowed to read). At commit time, it will flush those values to the central cache (taking in to account the since-locked descriptors), as well as checking for conflicts for serializable transactions by adding a check in thePreCommitCondition
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TransactionScopedCache
getReadOnlyTransactionScopedCacheForCommit(long startTs)
Returns a read-only view of the transaction cache at commit time (specifically, **after** getting the commit timestamp, but before ending the transaction).TransactionScopedCache
getTransactionScopedCache(long startTs)
void
processStartTransactions(Set<Long> startTimestamps)
void
removeTransactionState(long startTimestamp)
void
updateCacheOnCommit(Set<Long> startTimestamps)
This does *not* remove state from the cache -removeTransactionState(long)
must be called at the end of the transaction to do so, or else there will be a memory leak.
-
-
-
Method Detail
-
processStartTransactions
void processStartTransactions(Set<Long> startTimestamps)
- Specified by:
processStartTransactions
in interfacecom.palantir.lock.watch.LockWatchValueCache
-
updateCacheOnCommit
void updateCacheOnCommit(Set<Long> startTimestamps)
This does *not* remove state from the cache -removeTransactionState(long)
must be called at the end of the transaction to do so, or else there will be a memory leak.- Specified by:
updateCacheOnCommit
in interfacecom.palantir.lock.watch.LockWatchValueCache
-
removeTransactionState
void removeTransactionState(long startTimestamp)
- Specified by:
removeTransactionState
in interfacecom.palantir.lock.watch.LockWatchValueCache
-
getTransactionScopedCache
TransactionScopedCache getTransactionScopedCache(long startTs)
-
getReadOnlyTransactionScopedCacheForCommit
TransactionScopedCache getReadOnlyTransactionScopedCacheForCommit(long startTs)
Returns a read-only view of the transaction cache at commit time (specifically, **after** getting the commit timestamp, but before ending the transaction). This view will contain the local updates stored during the transaction, but will filter out any cells that have been locked between the start and commit of this transaction. The primary purpose of this cache is for serializable conflict checking.
-
-