Class NoOpTransactionScopedCache

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TransactionScopedCache create()  
      TransactionScopedCache createReadOnlyCache​(com.palantir.lock.watch.CommitUpdate commitUpdate)  
      void delete​(TableReference tableReference, java.util.Set<Cell> cells)  
      void finalise()
      This method should be called before retrieving the value or hit digest, as it guarantees that no more reads or writes will be performed on the cache.
      java.util.Map<Cell,​byte[]> get​(TableReference tableReference, java.util.Set<Cell> cells, java.util.function.Function<java.util.Set<Cell>,​com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​byte[]>>> valueLoader)
      This should be used for performing *synchronous* gets.
      com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​byte[]>> getAsync​(TableReference tableReference, java.util.Set<Cell> cells, java.util.function.Function<java.util.Set<Cell>,​com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​byte[]>>> valueLoader)  
      HitDigest getHitDigest()  
      java.util.NavigableMap<byte[],​RowResult<byte[]>> getRows​(TableReference tableRef, java.lang.Iterable<byte[]> rows, ColumnSelection columnSelection, java.util.function.Function<java.util.Set<Cell>,​java.util.Map<Cell,​byte[]>> cellLoader, java.util.function.Function<java.lang.Iterable<byte[]>,​java.util.NavigableMap<byte[],​RowResult<byte[]>>> rowLoader)
      The cache will try to fulfil as much of the request as possible with cached values.
      ValueDigest getValueDigest()  
      void write​(TableReference tableReference, java.util.Map<Cell,​byte[]> values)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public java.util.Map<Cell,​byte[]> get​(TableReference tableReference,
                                                    java.util.Set<Cell> cells,
                                                    java.util.function.Function<java.util.Set<Cell>,​com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​byte[]>>> valueLoader)
        Description copied from interface: TransactionScopedCache
        This should be used for performing *synchronous* gets. The reason the value loader function returns a listenable future is to optimise parallel requests to the cache: only the code that directly affects the state of the cache is synchronised, while loads from the database are done outside synchronised blocks.
        Specified by:
        get in interface TransactionScopedCache
      • getAsync

        public com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​byte[]>> getAsync​(TableReference tableReference,
                                                                                                             java.util.Set<Cell> cells,
                                                                                                             java.util.function.Function<java.util.Set<Cell>,​com.google.common.util.concurrent.ListenableFuture<java.util.Map<Cell,​byte[]>>> valueLoader)
        Specified by:
        getAsync in interface TransactionScopedCache
      • getRows

        public java.util.NavigableMap<byte[],​RowResult<byte[]>> getRows​(TableReference tableRef,
                                                                              java.lang.Iterable<byte[]> rows,
                                                                              ColumnSelection columnSelection,
                                                                              java.util.function.Function<java.util.Set<Cell>,​java.util.Map<Cell,​byte[]>> cellLoader,
                                                                              java.util.function.Function<java.lang.Iterable<byte[]>,​java.util.NavigableMap<byte[],​RowResult<byte[]>>> rowLoader)
        Description copied from interface: TransactionScopedCache
        The cache will try to fulfil as much of the request as possible with cached values. In the case where some of the columns are present in the cache for a row, the cellLoader will be used to read the remaining cells remotely. For rows that have none of the columns present in the cache, the rowLoader will be used. Note that this may result in two KVS reads, but it is expected to be offset by not having to read the already cached values. The result map uses UnsignedBytes.lexicographicalComparator() on the keys, so there will be no duplicate rows, even if duplicates were specified in rows. Any row with no columns present will be absent in the result map, as long as the rowLoader behaves in the same way.
        Specified by:
        getRows in interface TransactionScopedCache
      • finalise

        public void finalise()
        Description copied from interface: TransactionScopedCache
        This method should be called before retrieving the value or hit digest, as it guarantees that no more reads or writes will be performed on the cache. This method is idempotent, and may legitimately be called multiple times.
        Specified by:
        finalise in interface TransactionScopedCache