Class 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
    • Method Detail

      • getCacheName

        public String getCacheName()
        Obtain the cache name.
        Returns:
        the cache name
      • 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
      • 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
      • 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