Package com.oracle.coherence.grpc.proxy
Interface NamedCacheService
-
- All Superinterfaces:
GrpcProxyService
- All Known Implementing Classes:
NamedCacheServiceImpl
public interface NamedCacheService extends GrpcProxyService
A NamedCache service.- Since:
- 20.06
- Author:
- Mahesh Kannan 2019.11.01, Jonathan Knight 2019.11.07
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classNamedCacheService.DefaultDependenciesThe defaultNamedCacheService.Dependenciesimplementation.static interfaceNamedCacheService.DependenciesThe dependencies to configure aNamedCacheServiceImpl.
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICE_NAMEThe name of the gRPC service.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<com.google.protobuf.Empty>addIndex(com.oracle.coherence.grpc.AddIndexRequest request)Add an index to a cache.CompletionStage<com.google.protobuf.BytesValue>aggregate(com.oracle.coherence.grpc.AggregateRequest request)Execute anAggregateRequestagainst a cache and return the result serialized in aBytesValue.CompletionStage<com.google.protobuf.Empty>clear(com.oracle.coherence.grpc.ClearRequest request)Clear a cache.CompletionStage<com.google.protobuf.BoolValue>containsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request)Returnstrueif this map contains a mapping for the specified key to the specified value.CompletionStage<com.google.protobuf.BoolValue>containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request)Returnstrueif this map contains a mapping for the specified key.CompletionStage<com.google.protobuf.BoolValue>containsValue(com.oracle.coherence.grpc.ContainsValueRequest request)Returnstrueif this map contains a mapping for the specified value.<Req> CacheRequestHolder<Req,Void>createRequestHolder(Req request, String sScope, String sCacheName, String format)Create aCacheRequestHolderfor a given request.CompletionStage<com.google.protobuf.Empty>destroy(com.oracle.coherence.grpc.DestroyRequest request)Destroy a cache.<T> Filter<T>ensureFilter(com.google.protobuf.ByteString bytes, Serializer serializer)Obtain aFilterfrom the serialized data in aByteString.voidentrySet(com.oracle.coherence.grpc.EntrySetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Stream a set of cache entries to aStreamObserver.io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerRequest>events(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerResponse> observer)Add aMapListenerto a cache and stream the events received to theStreamObserver.CompletionStage<com.oracle.coherence.grpc.OptionalValue>get(com.oracle.coherence.grpc.GetRequest request)Get a value for a given key from a cache.voidgetAll(com.oracle.coherence.grpc.GetAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Obtain a stream of mappings of keys to values for all of the specified keys.<T> Filter<T>getFilter(com.google.protobuf.ByteString bytes, Serializer serializer)Obtain aFilterfrom the serialized data in aByteString.CompletionStage<com.google.protobuf.BytesValue>invoke(com.oracle.coherence.grpc.InvokeRequest request)Invoke anInvocableMap.EntryProcessoragainst an entry in a cache.voidinvokeAll(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Invoke anInvocableMap.EntryProcessoragainst multiple entries in a cache.CompletionStage<com.google.protobuf.BoolValue>isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request)Determine whether a cache is empty.CompletionStage<com.google.protobuf.BoolValue>isReady(com.oracle.coherence.grpc.IsReadyRequest request)Determine whether a cache is Ready.voidkeySet(com.oracle.coherence.grpc.KeySetRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Stream a set of cache keys to aStreamObserver.voidnextEntrySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.EntryResult> observer)Obtain the next page of a paged entry set request.voidnextKeySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Obtain the next page of a paged key set request.CompletionStage<com.google.protobuf.BytesValue>put(com.oracle.coherence.grpc.PutRequest request)Associate the specified value with the specified key in this cache.CompletionStage<com.google.protobuf.Empty>putAll(com.oracle.coherence.grpc.PutAllRequest request)Add the specified key value pair mappings to this cache.CompletionStage<com.google.protobuf.BytesValue>putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request)If the specified key is not already associated with a value (or is mapped tonull) associate it with the given value and returnsnull, else return the current value.CompletionStage<com.google.protobuf.BytesValue>remove(com.oracle.coherence.grpc.RemoveRequest request)Remove the mapping that is associated with the specified key.CompletionStage<com.google.protobuf.Empty>removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request)Remove an index from a cache.CompletionStage<com.google.protobuf.BoolValue>removeMapping(com.oracle.coherence.grpc.RemoveMappingRequest request)Remove the mapping that is associated with the specified key only if the mapping exists in the cache.CompletionStage<com.google.protobuf.BytesValue>replace(com.oracle.coherence.grpc.ReplaceRequest request)Replace the entry for the specified key only if it is currently mapped to some value.CompletionStage<com.google.protobuf.BoolValue>replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request)Replace the mapping for the specified key only if currently mapped to the specified value.CompletionStage<com.google.protobuf.Int32Value>size(com.oracle.coherence.grpc.SizeRequest request)Determine the number of entries in a cache.CompletionStage<com.google.protobuf.Empty>truncate(com.oracle.coherence.grpc.TruncateRequest request)Removes all mappings from this map.voidvalues(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Stream a set of cache values to aStreamObserver.-
Methods inherited from interface com.oracle.coherence.grpc.proxy.GrpcProxyService
getMetrics
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
The name of the gRPC service.- See Also:
- Constant Field Values
-
-
Method Detail
-
addIndex
CompletionStage<com.google.protobuf.Empty> addIndex(com.oracle.coherence.grpc.AddIndexRequest request)
Add an index to a cache.- Parameters:
request- theAddIndexRequestcontaining the name of the cache to add the index to, the serializedValueExtractorto use to create the index and the optional serializedComparatorto sort the index- Returns:
- a
CompletionStagethat will complete when the index is created
-
aggregate
CompletionStage<com.google.protobuf.BytesValue> aggregate(com.oracle.coherence.grpc.AggregateRequest request)
Execute anAggregateRequestagainst a cache and return the result serialized in aBytesValue.- Parameters:
request- theAggregateRequestto execute- Returns:
- the serialized aggregation result
-
clear
CompletionStage<com.google.protobuf.Empty> clear(com.oracle.coherence.grpc.ClearRequest request)
Clear a cache.- Parameters:
request- theClearRequestto execute- Returns:
- a
CompletionStagethat will complete when the cache has been cleared. - See Also:
NamedMap.clear()
-
containsEntry
CompletionStage<com.google.protobuf.BoolValue> containsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request)
Returnstrueif 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
CompletionStagethat 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(com.oracle.coherence.grpc.ContainsKeyRequest request)
Returnstrueif 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
CompletionStagethat 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(com.oracle.coherence.grpc.ContainsValueRequest request)
Returnstrueif 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
CompletionStagethat will complete with {code true} if this map contains a mapping for the specified value - See Also:
Map.containsKey(Object)
-
destroy
CompletionStage<com.google.protobuf.Empty> destroy(com.oracle.coherence.grpc.DestroyRequest request)
Destroy a cache.- Parameters:
request- theDestroyRequestcontaining the name of the cache to destroy- Returns:
- a
CompletionStagethat will complete when the cache is destroyed
-
entrySet
void entrySet(com.oracle.coherence.grpc.EntrySetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Stream a set of cache entries to aStreamObserver.- Parameters:
request- theEntrySetRequestto executeobserver- theStreamObserverto 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<com.oracle.coherence.grpc.MapListenerRequest> events(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerResponse> observer)
Add aMapListenerto a cache and stream the events received to theStreamObserver.- Parameters:
observer- theStreamObserverto receive events- Returns:
- a
StreamObserverthat will be closed by the client to end event subscription
-
get
CompletionStage<com.oracle.coherence.grpc.OptionalValue> get(com.oracle.coherence.grpc.GetRequest request)
Get a value for a given key from a cache.- Parameters:
request- theGetRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.get(Object) - See Also:
Map.get(Object)
-
getAll
void getAll(com.oracle.coherence.grpc.GetAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Obtain a stream of mappings of keys to values for all of the specified keys.- Parameters:
request- theGetAllRequestrequest containing the cache name and collection of keys to obtain the mappings forobserver- theStreamObserverto stream the results back to
-
invoke
CompletionStage<com.google.protobuf.BytesValue> invoke(com.oracle.coherence.grpc.InvokeRequest request)
Invoke anInvocableMap.EntryProcessoragainst an entry in a cache.- Parameters:
request- theInvokeRequestcontaining the serialized key of the entry and the serializedInvocableMap.EntryProcessor- Returns:
- the serialized result of the
InvocableMap.EntryProcessorinvocation
-
invokeAll
void invokeAll(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Invoke anInvocableMap.EntryProcessoragainst multiple entries in a cache.- Parameters:
request- theInvokeRequestcontaining the serialized keys or serializedFilterto use to identify the entries and the serializedInvocableMap.EntryProcessorobserver- theStreamObserverto observer the invocation results
-
isEmpty
CompletionStage<com.google.protobuf.BoolValue> isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request)
Determine whether a cache is empty.- Parameters:
request- theIsEmptyRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.isEmpty() - See Also:
Map.isEmpty()
-
isReady
CompletionStage<com.google.protobuf.BoolValue> isReady(com.oracle.coherence.grpc.IsReadyRequest request)
Determine whether a cache is Ready.- Parameters:
request- theIsReadyRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theNamedMap.isReady() - Since:
- 14.1.1.2206.5
- See Also:
NamedMap.isReady()
-
keySet
void keySet(com.oracle.coherence.grpc.KeySetRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Stream a set of cache keys to aStreamObserver.- Parameters:
request- theKeySetRequestto executeobserver- theStreamObserverto stream the keys to- See Also:
QueryMap.keySet(com.tangosol.util.Filter)
-
nextEntrySetPage
void nextEntrySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.EntryResult> observer)Obtain the next page of a paged entry set request.- Parameters:
request- thePageRequestto executeobserver- theStreamObserverthat will receive the responses
-
nextKeySetPage
void nextKeySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Obtain the next page of a paged key set request.- Parameters:
request- thePageRequestto executeobserver- theStreamObserverthat will receive the responses
-
put
CompletionStage<com.google.protobuf.BytesValue> put(com.oracle.coherence.grpc.PutRequest request)
Associate the specified value with the specified key in this cache. If the cache previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
request- thePutRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.put(Object, Object) - See Also:
Map.put(Object, Object)
-
putAll
CompletionStage<com.google.protobuf.Empty> putAll(com.oracle.coherence.grpc.PutAllRequest request)
Add the specified key value pair mappings to this cache. If the cache previously contained a mappings for the keys, the old value is replaced by the specified value.- Parameters:
request- thePutAllRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.putAll(java.util.Map) - See Also:
Map.putAll(java.util.Map)
-
putIfAbsent
CompletionStage<com.google.protobuf.BytesValue> putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request)
If the specified key is not already associated with a value (or is mapped tonull) associate it with the given value and returnsnull, else return the current value.- Parameters:
request- thePutIfAbsentRequestto execute- Returns:
- a
CompletionStagethat will complete with the previous value associated with the specified key, ornullif there was no mapping for the key. Anullreturn can also indicate that the map previously associatednullwith the key, if the implementation supportsnullvalues - See Also:
Map.putIfAbsent(Object, Object)
-
remove
CompletionStage<com.google.protobuf.BytesValue> remove(com.oracle.coherence.grpc.RemoveRequest request)
Remove the mapping that is associated with the specified key.- Parameters:
request- theRemoveRequestto execute- Returns:
- a
CompletionStagethat 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(com.oracle.coherence.grpc.RemoveIndexRequest request)
Remove an index from a cache.- Parameters:
request- theRemoveIndexRequestcontaining the name of the cache to remove the index from, the serializedValueExtractorthat was used to create the index- Returns:
- a
CompletionStagethat will complete when the index is removed
-
removeMapping
CompletionStage<com.google.protobuf.BoolValue> removeMapping(com.oracle.coherence.grpc.RemoveMappingRequest request)
Remove the mapping that is associated with the specified key only if the mapping exists in the cache.- Parameters:
request- theRemoveMappingRequestto execute- Returns:
- a
CompletionStagethat will complete withtrueif the removal was successful,falseotherwise - See Also:
Map.remove(Object, Object)
-
replace
CompletionStage<com.google.protobuf.BytesValue> replace(com.oracle.coherence.grpc.ReplaceRequest request)
Replace the entry for the specified key only if it is currently mapped to some value.- Parameters:
request- theReplaceRequestto execute- Returns:
- a
CompletionStagethat will complete with the previous value associated with specified key, or null if there was no mapping for key. - See Also:
Map.replace(Object, Object)
-
replaceMapping
CompletionStage<com.google.protobuf.BoolValue> replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request)
Replace the mapping for the specified key only if currently mapped to the specified value.- Parameters:
request- theReplaceMappingRequestto execute- Returns:
- a
CompletionStagethat will complete with the previous value associated with the specified key, ornullif there was no mapping for the key. Anullreturn can also indicate that the map previously associatednullwith the key, if the implementation supports null values - See Also:
Map.replace(Object, Object, Object)
-
size
CompletionStage<com.google.protobuf.Int32Value> size(com.oracle.coherence.grpc.SizeRequest request)
Determine the number of entries in a cache.- Parameters:
request- theSizeRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.size() - See Also:
Map.size()
-
truncate
CompletionStage<com.google.protobuf.Empty> truncate(com.oracle.coherence.grpc.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, orinterceptors. However, aCacheLifecycleEventis raised to notify subscribers of the execution of this operation.- Parameters:
request- theTruncateRequestcontaining the name of the cache to truncate- Returns:
- a
CompletionStagethat completes when the truncate operation has completed
-
values
void values(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Stream a set of cache values to aStreamObserver.- Parameters:
request- theValuesRequestto executeobserver- theStreamObserverto 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 aCacheRequestHolderfor a given request.- Type Parameters:
Req- the type of the request- Parameters:
request- the request object to add to the holdersScope- the scope name to use to identify the CCF to obtain the cache fromsCacheName- the name of the cache that the request executes againstformat- the optional serialization format used by requests that contain a payload- Returns:
- the
CacheRequestHolderholding the request
-
ensureFilter
<T> Filter<T> ensureFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
Obtain aFilterfrom the serialized data in aByteString.If the
ByteStringisnullorByteString.EMPTYthen anAlwaysFilteris returned.
-
getFilter
<T> Filter<T> getFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
Obtain aFilterfrom the serialized data in aByteString.
-
-