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 of CellReference -> value for each table. Applying lock watch events will: - for LockEvent, denote that the given descriptor cannot be cached; - for UnlockEvent, denote that the given descriptor can now be cached; - for LockWatchCreatedEvent, 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 the PreCommitCondition.
    • Method Detail

      • processStartTransactions

        void processStartTransactions​(Set<Long> startTimestamps)
        Specified by:
        processStartTransactions in interface com.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 interface com.palantir.lock.watch.LockWatchValueCache
      • removeTransactionState

        void removeTransactionState​(long startTimestamp)
        Specified by:
        removeTransactionState in interface com.palantir.lock.watch.LockWatchValueCache
      • 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.