Interface LockWatchingCache

    • Method Detail

      • getCached

        Map<Cell,​GuardedValue> getCached​(TableReference tableRef,
                                               Set<Cell> reads)
        Given a table and a set of cells, the cache returns a map containing the latest cached GuardedValues for cells present in the cache.
        Parameters:
        tableRef - table to read from
        reads - set of cells to read
        Returns:
        Cached values that are guaranteed to be the latest visible entries to the transaction making the request if the GuardedValue's timestamp matches the transaction's lock watch state
      • maybeCacheCommittedWrites

        void maybeCacheCommittedWrites​(TableReference tableRef,
                                       Map<Cell,​byte[]> writes)
        After a transaction has committed, this notifies the cache that the writes can be cached, if desired.
        Parameters:
        tableRef - the table to which the transaction wrote
        writes - actual writes
      • maybeCacheEntriesRead

        void maybeCacheEntriesRead​(TableReference tableRef,
                                   Map<Cell,​byte[]> writes,
                                   com.palantir.lock.watch.LockWatchStateUpdate lockWatchState)
        A transaction can attempt to cache entries read during the transaction using this method. The implementation of the LockWatchStateUpdate must correctly arbitrate which of the passed entries are safe to cache.
        Parameters:
        tableRef - table to cache entries for
        writes - entries read by the transaction
        lockWatchState - lock watch state at the start of the transaction that read the entries
      • getView

        TransactionLockWatchingCacheView getView​(long startTimestamp,
                                                 com.palantir.lock.watch.LockWatchStateUpdate lockWatchState)
        Creates a view of the cache for a transaction, based on the start timestamp and the lock watch state.
        Parameters:
        startTimestamp - of the transaction
        lockWatchState - returned from the StartTransactionWithWatchesResponse
        Returns:
        view of the cache