Class CacheRequestHolder<Req,Res>

java.lang.Object
com.oracle.coherence.grpc.RequestHolder<Req,Res>
com.oracle.coherence.grpc.CacheRequestHolder<Req,Res>
Type Parameters:
Req - the type of the request
Res - the result type

public class CacheRequestHolder<Req,Res> extends RequestHolder<Req,Res>
A class that holds a gRPC request, an associated NamedCache and Binary converters.
Since:
20.06
Author:
Jonathan Knight 2019.11.21
  • Field Details

  • Constructor Details

  • Method Details

    • getCacheName

      public String getCacheName()
      Obtain the cache name.
      Returns:
      the cache name
    • getAsyncCache

      public AsyncNamedCache<Binary,Binary> getAsyncCache()
      Obtain the AsyncNamedCache that the request executes on.
      Returns:
      the AsyncNamedCache that the request executes on
    • getCache

      public NamedCache<Binary,Binary> getCache()
      Obtain the NamedCache that the request executes on.
      Returns:
      the NamedCache that the request executes on
    • getNonPassThruCache

      public <K, V> NamedCache<K,V> getNonPassThruCache()
      Obtain the NamedCache that the request executes on.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      the NamedCache that the request executes on
    • getCacheSerializer

      public Serializer getCacheSerializer()
      Obtain the cache's Serializer.
      Returns:
      the cache's Serializer
    • convertKeyDown

      public Binary convertKeyDown(com.google.protobuf.ByteString bytes)
      Convert the ByteString data serialized in the request format to a Binary key serialized in the cache's serialization format.
      Parameters:
      bytes - the ByteString to convert
      Returns:
      a Binary key in the cache's serialization format
    • convertKeyDown

      public Binary convertKeyDown(Binary binary)
      Convert the Binary data serialized in the request format to a Binary key serialized in the cache's serialization format.
      Parameters:
      binary - the Binary to convert
      Returns:
      a Binary key in the cache's serialization format
    • ensureConverterKeyDown

      public Converter<Binary,Binary> ensureConverterKeyDown()
      Obtain the Converter used to convert between the request format keys and the cache format keys; creating the Converter if required.
      Returns:
      the Converter used to convert between the request format keys and the cache format keys
    • createConverterDown

      protected Converter<Object,Binary> createConverterDown()
      Description copied from class: RequestHolder
      Create the Converter to use to convert from Object form to internal Binary form.
      Specified by:
      createConverterDown in class RequestHolder<Req,Res>
      Returns:
      the Converter to use to convert from Object form to internal Binary form
    • runAsync

      public <T> CompletionStage<CacheRequestHolder<Req,T>> runAsync(CompletionStage<T> stage)
      Return a CompletionStage that will complete with a value of a RequestHolder with a result value that is the result of the completion of the specified CompletionStage.
      Type Parameters:
      T - the type of the CompletionStage value
      Parameters:
      stage - that stage that will provide the value for the RequestHolder
      Returns:
      a CompletionStage that completes with a RequestHolder
    • entryConsumer

      public Consumer<Map.Entry<? extends Binary,? extends Binary>> entryConsumer(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
      Return a Consumer of binary Map.Entry instances that sends the entries to the specified StreamObserver.
      Parameters:
      observer - the StreamObserver to receive the entries
      Returns:
      a Consumer of binary Map.Entry instances that sends the entries to the StreamObserver
    • binaryConsumer

      public Consumer<Binary> binaryConsumer(io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Return a Consumer of Binary instances that sends the binary to the specified StreamObserver.
      Parameters:
      observer - the StreamObserver to receive the binary values
      Returns:
      a Consumer of Binary instances that sends the binaries to the StreamObserver