Interface TransactionLockWatchingCacheView
-
- All Known Implementing Classes:
NoOpTransactionLockWatchingCacheView
public interface TransactionLockWatchingCacheView
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<Cell,byte[]>
readCached(TableReference tableRef, Set<Cell> cells)
Attempts to read the cached versions of cells.void
tryCacheNewValuesRead(TableReference tableRef, Map<Cell,byte[]> writes, com.palantir.lock.watch.LockWatchStateUpdate lwState)
Try to cache values read from the kvs in this transaction.void
tryCacheWrittenValues(TableReference tableRef, Map<Cell,byte[]> writes, long lockTs)
Try to cache values written to the kvs in this transaction.
-
-
-
Method Detail
-
readCached
Map<Cell,byte[]> readCached(TableReference tableRef, Set<Cell> cells)
Attempts to read the cached versions of cells. If there is no suitable cached value for the cell, it will not be present in the returned map.- Parameters:
tableRef
- table to read fromcells
- cells to read- Returns:
- a mapping with all cells that were cached and guaranteed to be equal to what the transaction would have read from the kvs.
-
tryCacheNewValuesRead
void tryCacheNewValuesRead(TableReference tableRef, Map<Cell,byte[]> writes, com.palantir.lock.watch.LockWatchStateUpdate lwState)
Try to cache values read from the kvs in this transaction. It is the responsibility of the underlyingLockWatchingCache
to arbitrate which, if any, values should be cached.- Parameters:
tableRef
- table we read fromwrites
- entries read from the KVSlwState
- lock watch state when the view was created
-
tryCacheWrittenValues
void tryCacheWrittenValues(TableReference tableRef, Map<Cell,byte[]> writes, long lockTs)
Try to cache values written to the kvs in this transaction. This method must be called only after the writing transaction has successfully committed. It is the responsibility of the underlyingLockWatchingCache
to arbitrate which, if any, values should be cached.- Parameters:
tableRef
- table we wrote towrites
- entries written to the KVSlockTs
- lock timestamp of theTimestampedLockResponse
from acquiring locks
-
-