Interface NamedCacheService

    • Method Detail

      • addIndex

        CompletionStage<com.google.protobuf.Empty> addIndex​(AddIndexRequest request)
        Add an index to a cache.
        Parameters:
        request - the AddIndexRequest containing the name of the cache to add the index to, the serialized ValueExtractor to use to create the index and the optional serialized Comparator to sort the index
        Returns:
        a CompletionStage that will complete when the index is created
      • containsEntry

        CompletionStage<com.google.protobuf.BoolValue> containsEntry​(ContainsEntryRequest request)
        Returns true if this map contains a mapping for the specified key to the specified value.
        Parameters:
        request - the request which contains the key and value whose presence in this map is to be tested
        Returns:
        a CompletionStage that will complete with {code true} if this map contains a mapping for the specified key to the specified value
        See Also:
        Map.containsKey(Object)
      • containsKey

        CompletionStage<com.google.protobuf.BoolValue> containsKey​(ContainsKeyRequest request)
        Returns true if this map contains a mapping for the specified key.
        Parameters:
        request - the request which contains the key whose presence in this map is to be tested
        Returns:
        a CompletionStage that will complete with {code true} if this map contains a mapping for the specified key
        See Also:
        Map.containsKey(Object)
      • containsValue

        CompletionStage<com.google.protobuf.BoolValue> containsValue​(ContainsValueRequest request)
        Returns true if this map contains a mapping for the specified value.
        Parameters:
        request - the request which contains the value whose presence in this map is to be tested
        Returns:
        a CompletionStage that will complete with {code true} if this map contains a mapping for the specified value
        See Also:
        Map.containsKey(Object)
      • entrySet

        void entrySet​(EntrySetRequest request,
                      io.grpc.stub.StreamObserver<Entry> observer)
        Stream a set of cache entries to a StreamObserver.
        Parameters:
        request - the EntrySetRequest to execute
        observer - the StreamObserver to stream the entries to
        See Also:
        QueryMap.entrySet(com.tangosol.util.Filter), QueryMap.entrySet(com.tangosol.util.Filter, java.util.Comparator)
      • events

        io.grpc.stub.StreamObserver<MapListenerRequest> events​(io.grpc.stub.StreamObserver<MapListenerResponse> observer)
        Add a MapListener to a cache and stream the events received to the StreamObserver.
        Parameters:
        observer - the StreamObserver to receive events
        Returns:
        a StreamObserver that will be closed by the client to end event subscription
      • getAll

        void getAll​(GetAllRequest request,
                    io.grpc.stub.StreamObserver<Entry> observer)
        Obtain a stream of mappings of keys to values for all of the specified keys.
        Parameters:
        request - the GetAllRequest request containing the cache name and collection of keys to obtain the mappings for
        observer - the StreamObserver to stream the results back to
      • invoke

        CompletionStage<com.google.protobuf.BytesValue> invoke​(InvokeRequest request)
        Invoke an InvocableMap.EntryProcessor against an entry in a cache.
        Parameters:
        request - the InvokeRequest containing the serialized key of the entry and the serialized InvocableMap.EntryProcessor
        Returns:
        the serialized result of the InvocableMap.EntryProcessor invocation
      • invokeAll

        void invokeAll​(InvokeAllRequest request,
                       io.grpc.stub.StreamObserver<Entry> observer)
        Invoke an InvocableMap.EntryProcessor against multiple entries in a cache.
        Parameters:
        request - the InvokeRequest containing the serialized keys or serialized Filter to use to identify the entries and the serialized InvocableMap.EntryProcessor
        observer - the StreamObserver to observer the invocation results
      • isReady

        CompletionStage<com.google.protobuf.BoolValue> isReady​(IsReadyRequest request)
        Determine whether a cache is Ready.
        Parameters:
        request - the IsReadyRequest to execute
        Returns:
        a CompletionStage that will complete with the result of the NamedMap.isReady()
        Since:
        14.1.1.2206.5
        See Also:
        NamedMap.isReady()
      • keySet

        void keySet​(KeySetRequest request,
                    io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
        Stream a set of cache keys to a StreamObserver.
        Parameters:
        request - the KeySetRequest to execute
        observer - the StreamObserver to stream the keys to
        See Also:
        QueryMap.keySet(com.tangosol.util.Filter)
      • nextEntrySetPage

        void nextEntrySetPage​(PageRequest request,
                              io.grpc.stub.StreamObserver<EntryResult> observer)
        Obtain the next page of a paged entry set request.
        Parameters:
        request - the PageRequest to execute
        observer - the StreamObserver that will receive the responses
      • nextKeySetPage

        void nextKeySetPage​(PageRequest request,
                            io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
        Obtain the next page of a paged key set request.
        Parameters:
        request - the PageRequest to execute
        observer - the StreamObserver that will receive the responses
      • putIfAbsent

        CompletionStage<com.google.protobuf.BytesValue> putIfAbsent​(PutIfAbsentRequest request)
        If the specified key is not already associated with a value (or is mapped to null) associate it with the given value and returns null, else return the current value.
        Parameters:
        request - the PutIfAbsentRequest to execute
        Returns:
        a CompletionStage that will complete with the previous value associated with the specified key, or null if there was no mapping for the key. A null return can also indicate that the map previously associated null with the key, if the implementation supports null values
        See Also:
        Map.putIfAbsent(Object, Object)
      • remove

        CompletionStage<com.google.protobuf.BytesValue> remove​(RemoveRequest request)
        Remove the mapping that is associated with the specified key.
        Parameters:
        request - the RemoveRequest to execute
        Returns:
        a CompletionStage that will complete with the previous value associated with specified key, or null if there was no mapping for key.
        See Also:
        Map.remove(Object)
      • removeIndex

        CompletionStage<com.google.protobuf.Empty> removeIndex​(RemoveIndexRequest request)
        Remove an index from a cache.
        Parameters:
        request - the RemoveIndexRequest containing the name of the cache to remove the index from, the serialized ValueExtractor that was used to create the index
        Returns:
        a CompletionStage that will complete when the index is removed
      • replaceMapping

        CompletionStage<com.google.protobuf.BoolValue> replaceMapping​(ReplaceMappingRequest request)
        Replace the mapping for the specified key only if currently mapped to the specified value.
        Parameters:
        request - the ReplaceMappingRequest to execute
        Returns:
        a CompletionStage that will complete with the previous value associated with the specified key, or null if there was no mapping for the key. A null return can also indicate that the map previously associated null with the key, if the implementation supports null values
        See Also:
        Map.replace(Object, Object, Object)
      • truncate

        CompletionStage<com.google.protobuf.Empty> truncate​(TruncateRequest request)
        Removes all mappings from this map.

        Note: the removal of entries caused by this truncate operation will not be observable. This includes any registered listeners, triggers, or interceptors. However, a CacheLifecycleEvent is raised to notify subscribers of the execution of this operation.

        Parameters:
        request - the TruncateRequest containing the name of the cache to truncate
        Returns:
        a CompletionStage that completes when the truncate operation has completed
      • values

        void values​(ValuesRequest request,
                    io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
        Stream a set of cache values to a StreamObserver.
        Parameters:
        request - the ValuesRequest to execute
        observer - the StreamObserver to stream the values to
        See Also:
        QueryMap.values(com.tangosol.util.Filter), QueryMap.values(com.tangosol.util.Filter, java.util.Comparator)
      • createRequestHolder

        <Req> CacheRequestHolder<Req,​Void> createRequestHolder​(Req request,
                                                                     String sScope,
                                                                     String sCacheName,
                                                                     String format)
        Create a CacheRequestHolder for a given request.
        Type Parameters:
        Req - the type of the request
        Parameters:
        request - the request object to add to the holder
        sScope - the scope name to use to identify the CCF to obtain the cache from
        sCacheName - the name of the cache that the request executes against
        format - the optional serialization format used by requests that contain a payload
        Returns:
        the CacheRequestHolder holding the request
      • ensureFilter

        <T> com.tangosol.util.Filter<T> ensureFilter​(com.google.protobuf.ByteString bytes,
                                                     com.tangosol.io.Serializer serializer)
        Obtain a Filter from the serialized data in a ByteString.

        If the ByteString is null or ByteString.EMPTY then an AlwaysFilter is returned.

        Type Parameters:
        T - the Filter type
        Parameters:
        bytes - the ByteString containing the serialized Filter
        serializer - the serializer to use
        Returns:
        a deserialized Filter
      • getFilter

        <T> com.tangosol.util.Filter<T> getFilter​(com.google.protobuf.ByteString bytes,
                                                  com.tangosol.io.Serializer serializer)
        Obtain a Filter from the serialized data in a ByteString.
        Type Parameters:
        T - the Filter type
        Parameters:
        bytes - the ByteString containing the serialized Filter
        serializer - the serializer to use
        Returns:
        a deserialized Filter or null if no filter is set