Package com.oracle.coherence.grpc.proxy
Class NettyNamedCacheService
java.lang.Object
com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
com.oracle.coherence.grpc.proxy.common.BaseNamedCacheServiceImpl
com.oracle.coherence.grpc.proxy.NettyNamedCacheService
- All Implemented Interfaces:
GrpcProxyService
,NamedCacheService
An async gRPC
NamedCacheService
.
This class uses AsyncNamedCache
and asynchronous CompletionStage
wherever possible. This makes the code more complex but the advantages of not blocking the gRPC
request thread or the Coherence service thread will outweigh the downside of complexity.
The asynchronous processing of CompletionStage
s is done using an
DaemonPoolExecutor
so as not to consume or block threads in the Fork Join Pool.
The DaemonPoolExecutor
is
configurable so that its thread counts can be controlled.
- Since:
- 20.06
- Author:
- Jonathan Knight 2020.09.22
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
BaseGrpcServiceImpl.DefaultDependencies, BaseGrpcServiceImpl.Dependencies
Nested classes/interfaces inherited from interface com.oracle.coherence.grpc.proxy.common.NamedCacheService
NamedCacheService.DefaultDependencies, NamedCacheService.Dependencies
-
Field Summary
Fields inherited from class com.oracle.coherence.grpc.proxy.common.BaseNamedCacheServiceImpl
INVALID_CACHE_NAME_MESSAGE, INVALID_REQUEST_MESSAGE, MBEAN_NAME, MISSING_AGGREGATOR_MESSAGE, MISSING_EXTRACTOR_MESSAGE, MISSING_PROCESSOR_MESSAGE
Fields inherited from class com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
DEFAULT_TRANSFER_THRESHOLD, f_cacheFactorySupplier, f_dependencies, f_executor, f_metrics, f_serializerProducer, transferThreshold, VOID
Fields inherited from interface com.oracle.coherence.grpc.proxy.common.NamedCacheService
SERVICE_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionNettyNamedCacheService
(NamedCacheService.Dependencies dependencies) Create aNettyNamedCacheService
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIndex
(com.oracle.coherence.grpc.AddIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Add an index to a cache.void
aggregate
(com.oracle.coherence.grpc.AggregateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute anAggregateRequest
against a cache and return the result serialized in aBytesValue
.protected CompletionStage
<CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest, Binary>> containsEntry
(CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest, Void> holder) Execute theContainsEntryRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of the contains entry request as a serialized Boolean.void
containsEntry
(com.oracle.coherence.grpc.ContainsEntryRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Returnstrue
if this map contains a mapping for the specified key to the specified value.protected CompletionStage
<CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest, Boolean>> containsKey
(CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest, Void> holder) Execute theContainsKeyRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of the contains key request.void
containsKey
(com.oracle.coherence.grpc.ContainsKeyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Returnstrue
if this map contains a mapping for the specified key.protected CompletionStage
<CacheRequestHolder<com.oracle.coherence.grpc.ContainsValueRequest, Integer>> containsValue
(CacheRequestHolder<com.oracle.coherence.grpc.ContainsValueRequest, Void> holder) Execute theContainsValueRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of the contains value request as a serialized Boolean.void
containsValue
(com.oracle.coherence.grpc.ContainsValueRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Returnstrue
if this map contains a mapping for the specified value.protected CompletionStage
<List<Binary>> convertKeys
(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest, Void> holder) Convert the keys for aGetAllRequest
from the request's serialization format to the cache's serialization format.protected Void
entrySet
(CacheRequestHolder<com.oracle.coherence.grpc.EntrySetRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute theEntrySetRequest
request and send the results to theStreamObserver
.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
.protected CompletionStage
<CacheRequestHolder<com.oracle.coherence.grpc.GetRequest, Binary>> get
(CacheRequestHolder<com.oracle.coherence.grpc.GetRequest, Void> holder) Execute theGetRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of theGetRequest
request as a serialized Boolean.void
get
(com.oracle.coherence.grpc.GetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.OptionalValue> observer) Get a value for a given key from a cache.protected Void
getAll
(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute theGetAllRequest
request and send the results to theStreamObserver
.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 the specified keys.protected CompletionStage
<CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest, Binary>> invoke
(CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest, Void> holder) Execute theInvokeRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of theInvokeRequest
request as a serialized Boolean.void
invoke
(com.oracle.coherence.grpc.InvokeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Invoke anInvocableMap.EntryProcessor
against an entry in a cache.void
invokeAll
(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Invoke anInvocableMap.EntryProcessor
against multiple entries in a cache.protected CompletionStage
<Void> invokeAllWithFilter
(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the filteredInvokeAllRequest
request passing the results to the providedStreamObserver
.protected CompletionStage
<Void> invokeAllWithFilter
(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the filteredInvokeAllRequest
request passing the results to the providedStreamObserver
.protected CompletionStage
<Void> invokeAllWithKeys
(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the key-basedInvokeAllRequest
request passing the results to the providedStreamObserver
.protected CompletionStage
<Void> invokeAllWithKeys
(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the key-basedInvokeAllRequest
request passing the results to the providedStreamObserver
.void
isEmpty
(com.oracle.coherence.grpc.IsEmptyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Determine whether a cache is empty.void
isReady
(com.oracle.coherence.grpc.IsReadyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Determine whether a cache is Ready.protected Void
keySet
(CacheRequestHolder<com.oracle.coherence.grpc.KeySetRequest, Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute the key-basedKeySetRequest
request passing the results to the providedStreamObserver
.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
.static NettyNamedCacheService
Create an instance ofNettyNamedCacheService
using the default dependencies configuration.static NettyNamedCacheService
Create an instance ofNettyNamedCacheService
using the default dependencies configuration.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.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.protected CompletionStage
<com.google.protobuf.BytesValue> put
(CacheRequestHolder<com.oracle.coherence.grpc.PutRequest, Void> holder) Execute a put request.void
put
(com.oracle.coherence.grpc.PutRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Associate the specified value with the specified key in this cache.protected CompletionStage
<com.google.protobuf.Empty> putAll
(CacheRequestHolder<com.oracle.coherence.grpc.PutAllRequest, Void> holder) Execute a putAll request.void
putAll
(com.oracle.coherence.grpc.PutAllRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Add the specified key value pair mappings to this cache.protected CompletableFuture
<com.google.protobuf.BytesValue> putIfAbsent
(CacheRequestHolder<com.oracle.coherence.grpc.PutIfAbsentRequest, Void> holder) Execute aPutIfAbsentRequest
request.void
putIfAbsent
(com.oracle.coherence.grpc.PutIfAbsentRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) 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.protected CompletableFuture
<Binary> remove
(CacheRequestHolder<com.oracle.coherence.grpc.RemoveRequest, Void> holder) Execute aRemoveRequest
request.void
remove
(com.oracle.coherence.grpc.RemoveRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Remove the mapping that is associated with the specified key.void
removeIndex
(com.oracle.coherence.grpc.RemoveIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Remove an index from a cache.protected CompletionStage
<CacheRequestHolder<com.oracle.coherence.grpc.RemoveMappingRequest, Boolean>> removeMapping
(CacheRequestHolder<com.oracle.coherence.grpc.RemoveMappingRequest, Void> holder) Execute theRemoveMappingRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of theRemoveMappingRequest
request as a serialized Boolean.void
removeMapping
(com.oracle.coherence.grpc.RemoveMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Remove the mapping that is associated with the specified key only if the mapping exists in the cache.protected CompletableFuture
<Binary> replace
(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceRequest, Void> holder) Execute aReplaceRequest
request.void
replace
(com.oracle.coherence.grpc.ReplaceRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Replace the entry for the specified key only if it is currently mapped to some value.protected CompletableFuture
<Binary> replaceMapping
(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceMappingRequest, Void> holder) Execute aReplaceMappingRequest
request.void
replaceMapping
(com.oracle.coherence.grpc.ReplaceMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Replace the mapping for the specified key only if currently mapped to the specified value.void
size
(com.oracle.coherence.grpc.SizeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Int32Value> observer) Determine the number of entries in a cache.void
truncate
(com.oracle.coherence.grpc.TruncateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Removes all mappings from this map.protected Void
values
(CacheRequestHolder<com.oracle.coherence.grpc.ValuesRequest, Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute theValuesRequest
request passing the results to the providedStreamObserver
.void
values
(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute theValuesRequest
request passing the results to the providedStreamObserver
.Methods inherited from class com.oracle.coherence.grpc.proxy.common.BaseNamedCacheServiceImpl
addIndex, aggregateWithFilter, aggregateWithFilter, aggregateWithKeys, aggregateWithKeys, castProcessor, clear, convertKeysToBinary, createHolderAsync, createRequestHolder, deserializeComparator, destroy, empty, ensureFilter, ensureValueExtractor, events, execute, execute, getAsyncCache, getCache, getCCF, getFilter, getPassThroughCache, partitionedPutAll, plainPutAll, removeIndex, toBoolValue
Methods inherited from class com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
createDefaultExecutor, getExecutor, getMetrics, getSerializer, getTransferThreshold
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.oracle.coherence.grpc.proxy.common.GrpcProxyService
getMetrics
Methods inherited from interface com.oracle.coherence.grpc.proxy.common.NamedCacheService
clear, createRequestHolder, destroy, ensureFilter, events, getFilter
-
Constructor Details
-
NettyNamedCacheService
Create aNettyNamedCacheService
.- Parameters:
dependencies
- theNamedCacheService.Dependencies
to use to configure the service
-
-
Method Details
-
newInstance
Create an instance ofNettyNamedCacheService
using the default dependencies configuration.- Parameters:
deps
- theNamedCacheService.Dependencies
to use to create the service- Returns:
- an instance of
NettyNamedCacheService
-
newInstance
Create an instance ofNettyNamedCacheService
using the default dependencies configuration.- Returns:
- an instance of
NettyNamedCacheService
-
addIndex
public void addIndex(com.oracle.coherence.grpc.AddIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheService
Add an index to a cache.- Specified by:
addIndex
in interfaceNamedCacheService
- Parameters:
request
- theAddIndexRequest
containing the name of the cache to add the index to, the serializedValueExtractor
to use to create the index and the optional serializedComparator
to sort the indexobserver
- theStreamObserver
to receive the response
-
aggregate
public void aggregate(com.oracle.coherence.grpc.AggregateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
Execute anAggregateRequest
against a cache and return the result serialized in aBytesValue
.- Specified by:
aggregate
in interfaceNamedCacheService
- Parameters:
request
- theAggregateRequest
to executeobserver
- theStreamObserver
to receive the response
-
containsEntry
public void containsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Returnstrue
if this map contains a mapping for the specified key to the specified value.- Specified by:
containsEntry
in interfaceNamedCacheService
- Parameters:
request
- the request which contains the key and value whose presence in this map is to be testedobserver
- theStreamObserver
to receive the response- See Also:
-
containsEntry
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest,Binary>> containsEntry(CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest, Void> holder) Execute theContainsEntryRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of the contains entry request as a serialized Boolean.- Parameters:
holder
- theCacheRequestHolder
containing theContainsEntryRequest
request- Returns:
- a
CompletionStage
that completes with aCacheRequestHolder
containing the serialized Boolean result of executing theContainsEntryRequest
request
-
containsKey
public void containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Returnstrue
if this map contains a mapping for the specified key.- Specified by:
containsKey
in interfaceNamedCacheService
- Parameters:
request
- the request which contains the key whose presence in this map is to be testedobserver
- theStreamObserver
to receive the response- See Also:
-
containsKey
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest,Boolean>> containsKey(CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest, Void> holder) Execute theContainsKeyRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of the contains key request.- Parameters:
holder
- theCacheRequestHolder
containing theContainsKeyRequest
request- Returns:
- a
CompletionStage
that completes with aCacheRequestHolder
containing the Boolean result of executing theContainsKeyRequest
request
-
containsValue
public void containsValue(com.oracle.coherence.grpc.ContainsValueRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Returnstrue
if this map contains a mapping for the specified value.- Specified by:
containsValue
in interfaceNamedCacheService
- Parameters:
request
- the request which contains the value whose presence in this map is to be testedobserver
- theStreamObserver
to receive the response- See Also:
-
containsValue
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsValueRequest,Integer>> containsValue(CacheRequestHolder<com.oracle.coherence.grpc.ContainsValueRequest, Void> holder) Execute theContainsValueRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of the contains value request as a serialized Boolean.- Parameters:
holder
- theCacheRequestHolder
containing theContainsValueRequest
request- Returns:
- a
CompletionStage
that completes with aCacheRequestHolder
containing the serialized Boolean result of executing theContainsValueRequest
request
-
entrySet
public void entrySet(com.oracle.coherence.grpc.EntrySetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Description copied from interface:NamedCacheService
Stream a set of cache entries to aStreamObserver
.- Specified by:
entrySet
in interfaceNamedCacheService
- Parameters:
request
- theEntrySetRequest
to executeobserver
- theStreamObserver
to stream the entries to- See Also:
-
entrySet
protected Void entrySet(CacheRequestHolder<com.oracle.coherence.grpc.EntrySetRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute theEntrySetRequest
request and send the results to theStreamObserver
.- Parameters:
holder
- theCacheRequestHolder
containing theEntrySetRequest
requestobserver
- theStreamObserver
which will receive results- Returns:
- always return
Void
-
get
public void get(com.oracle.coherence.grpc.GetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.OptionalValue> observer) Description copied from interface:NamedCacheService
Get a value for a given key from a cache.- Specified by:
get
in interfaceNamedCacheService
- Parameters:
request
- theGetRequest
to executeobserver
- theStreamObserver
to receive events- See Also:
-
get
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.GetRequest,Binary>> get(CacheRequestHolder<com.oracle.coherence.grpc.GetRequest, Void> holder) Execute theGetRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of theGetRequest
request as a serialized Boolean.- Parameters:
holder
- theCacheRequestHolder
containing theGetRequest
request- Returns:
- a
CompletionStage
that completes with aCacheRequestHolder
containing the serialized Binary result of executing theGetRequest
request
-
getAll
public void getAll(com.oracle.coherence.grpc.GetAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Description copied from interface:NamedCacheService
Obtain a stream of mappings of keys to values for all the specified keys.- Specified by:
getAll
in interfaceNamedCacheService
- Parameters:
request
- theGetAllRequest
request containing the cache name and collection of keys to obtain the mappings forobserver
- theStreamObserver
to stream the results back to
-
getAll
protected Void getAll(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute theGetAllRequest
request and send the results to theStreamObserver
.- Parameters:
holder
- theCacheRequestHolder
containing theGetAllRequest
requestobserver
- theStreamObserver
which will receive results- Returns:
- always return
Void
-
invoke
public void invoke(com.oracle.coherence.grpc.InvokeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
Invoke anInvocableMap.EntryProcessor
against an entry in a cache.- Specified by:
invoke
in interfaceNamedCacheService
- Parameters:
request
- theInvokeRequest
containing the serialized key of the entry and the serializedInvocableMap.EntryProcessor
observer
- theStreamObserver
to stream the results back to
-
invoke
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest,Binary>> invoke(CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest, Void> holder) Execute theInvokeRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of theInvokeRequest
request as a serialized Boolean.- Parameters:
holder
- theCacheRequestHolder
containing theInvokeRequest
request- Returns:
- a
CompletionStage
that completes with aCacheRequestHolder
containing the serialized Binary result of executing theInvokeRequest
request
-
invokeAll
public void invokeAll(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Description copied from interface:NamedCacheService
Invoke anInvocableMap.EntryProcessor
against multiple entries in a cache.- Specified by:
invokeAll
in interfaceNamedCacheService
- Parameters:
request
- theInvokeRequest
containing the serialized keys or serializedFilter
to use to identify the entries and the serializedInvocableMap.EntryProcessor
observer
- theStreamObserver
to observer the invocation results
-
invokeAllWithFilter
protected CompletionStage<Void> invokeAllWithFilter(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the filteredInvokeAllRequest
request passing the results to the providedStreamObserver
.- Parameters:
request
- theInvokeAllRequest
observer
- theStreamObserver
which will receive the results- Returns:
- always returns a
CompletionStage
returningVoid
-
invokeAllWithFilter
protected CompletionStage<Void> invokeAllWithFilter(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the filteredInvokeAllRequest
request passing the results to the providedStreamObserver
.- Parameters:
holder
- theCacheRequestHolder
containing theInvokeAllRequest
observer
- theStreamObserver
which will receive the results- Returns:
- always returns a
CompletionStage
returningVoid
-
invokeAllWithKeys
protected CompletionStage<Void> invokeAllWithKeys(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the key-basedInvokeAllRequest
request passing the results to the providedStreamObserver
.- Parameters:
request
- theInvokeAllRequest
observer
- theStreamObserver
which will receive the results- Returns:
- always returns a
CompletionStage
returningVoid
-
invokeAllWithKeys
protected CompletionStage<Void> invokeAllWithKeys(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the key-basedInvokeAllRequest
request passing the results to the providedStreamObserver
.- Parameters:
holder
- theCacheRequestHolder
containing theInvokeAllRequest
observer
- theStreamObserver
which will receive the results- Returns:
- always returns a
CompletionStage
returningVoid
-
isEmpty
public void isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Determine whether a cache is empty.- Specified by:
isEmpty
in interfaceNamedCacheService
- Parameters:
request
- theIsEmptyRequest
to executeobserver
- theStreamObserver
to observer the invocation results- See Also:
-
isReady
public void isReady(com.oracle.coherence.grpc.IsReadyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Determine whether a cache is Ready.- Specified by:
isReady
in interfaceNamedCacheService
- Parameters:
request
- theIsReadyRequest
to executeobserver
- theStreamObserver
to observer the invocation results- See Also:
-
keySet
public void keySet(com.oracle.coherence.grpc.KeySetRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
Stream a set of cache keys to aStreamObserver
.- Specified by:
keySet
in interfaceNamedCacheService
- Parameters:
request
- theKeySetRequest
to executeobserver
- theStreamObserver
to stream the keys to- See Also:
-
keySet
protected Void keySet(CacheRequestHolder<com.oracle.coherence.grpc.KeySetRequest, Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute the key-basedKeySetRequest
request passing the results to the providedStreamObserver
.- Parameters:
holder
- theCacheRequestHolder
containing theKeySetRequest
observer
- theStreamObserver
which will receive the results- Returns:
- always returns
Void
-
nextKeySetPage
public void nextKeySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
Obtain the next page of a paged key set request.- Specified by:
nextKeySetPage
in interfaceNamedCacheService
- Parameters:
request
- thePageRequest
to executeobserver
- theStreamObserver
that will receive the responses
-
nextEntrySetPage
public void nextEntrySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.EntryResult> observer) Description copied from interface:NamedCacheService
Obtain the next page of a paged entry set request.- Specified by:
nextEntrySetPage
in interfaceNamedCacheService
- Parameters:
request
- thePageRequest
to executeobserver
- theStreamObserver
that will receive the responses
-
put
public void put(com.oracle.coherence.grpc.PutRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
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.- Specified by:
put
in interfaceNamedCacheService
- Parameters:
request
- thePutRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
put
protected CompletionStage<com.google.protobuf.BytesValue> put(CacheRequestHolder<com.oracle.coherence.grpc.PutRequest, Void> holder) Execute a put request.- Parameters:
holder
- theCacheRequestHolder
containing thePutRequest
request- Returns:
- a
CompletionStage
that completes with aBytesValue
containing the serialized result of executing thePutRequest
request
-
putAll
public void putAll(com.oracle.coherence.grpc.PutAllRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheService
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.- Specified by:
putAll
in interfaceNamedCacheService
- Parameters:
request
- thePutAllRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
putAll
protected CompletionStage<com.google.protobuf.Empty> putAll(CacheRequestHolder<com.oracle.coherence.grpc.PutAllRequest, Void> holder) Execute a putAll request.- Parameters:
holder
- theCacheRequestHolder
containing thePutAllRequest
request- Returns:
- a
CompletionStage
that completes after executing thePutAllRequest
request
-
putIfAbsent
public void putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
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.- Specified by:
putIfAbsent
in interfaceNamedCacheService
- Parameters:
request
- thePutIfAbsentRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
putIfAbsent
protected CompletableFuture<com.google.protobuf.BytesValue> putIfAbsent(CacheRequestHolder<com.oracle.coherence.grpc.PutIfAbsentRequest, Void> holder) Execute aPutIfAbsentRequest
request.- Parameters:
holder
- theCacheRequestHolder
containing thePutIfAbsentRequest
request- Returns:
- a
CompletionStage
that completes with aBytesValue
containing the serialized result of executing thePutIfAbsentRequest
request
-
remove
public void remove(com.oracle.coherence.grpc.RemoveRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
Remove the mapping that is associated with the specified key.- Specified by:
remove
in interfaceNamedCacheService
- Parameters:
request
- theRemoveRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
remove
protected CompletableFuture<Binary> remove(CacheRequestHolder<com.oracle.coherence.grpc.RemoveRequest, Void> holder) Execute aRemoveRequest
request.- Parameters:
holder
- theCacheRequestHolder
containing theRemoveRequest
request- Returns:
- a
CompletionStage
that completes with aBinary
containing the serialized result of executing theRemoveRequest
request
-
removeIndex
public void removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheService
Remove an index from a cache.- Specified by:
removeIndex
in interfaceNamedCacheService
- Parameters:
request
- theRemoveIndexRequest
containing the name of the cache to remove the index from, the serializedValueExtractor
that was used to create the indexobserver
- theStreamObserver
that will receive the responses
-
removeMapping
public void removeMapping(com.oracle.coherence.grpc.RemoveMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Remove the mapping that is associated with the specified key only if the mapping exists in the cache.- Specified by:
removeMapping
in interfaceNamedCacheService
- Parameters:
request
- theRemoveMappingRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
removeMapping
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.RemoveMappingRequest,Boolean>> removeMapping(CacheRequestHolder<com.oracle.coherence.grpc.RemoveMappingRequest, Void> holder) Execute theRemoveMappingRequest
request and return aCompletionStage
that will complete when theAsyncNamedCache
request completes and will contain aCacheRequestHolder
holding the result of theRemoveMappingRequest
request as a serialized Boolean.- Parameters:
holder
- theCacheRequestHolder
containing theRemoveMappingRequest
request- Returns:
- a
CompletionStage
that completes with aCacheRequestHolder
containing the serialized Binary result of executing theRemoveMappingRequest
request
-
replace
public void replace(com.oracle.coherence.grpc.ReplaceRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheService
Replace the entry for the specified key only if it is currently mapped to some value.- Specified by:
replace
in interfaceNamedCacheService
- Parameters:
request
- theReplaceRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
replace
protected CompletableFuture<Binary> replace(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceRequest, Void> holder) Execute aReplaceRequest
request.- Parameters:
holder
- theCacheRequestHolder
containing theReplaceRequest
request- Returns:
- a
CompletionStage
that completes with aBinary
containing the serialized result of executing theReplaceRequest
request
-
replaceMapping
public void replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheService
Replace the mapping for the specified key only if currently mapped to the specified value.- Specified by:
replaceMapping
in interfaceNamedCacheService
- Parameters:
request
- theReplaceMappingRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
replaceMapping
protected CompletableFuture<Binary> replaceMapping(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceMappingRequest, Void> holder) Execute aReplaceMappingRequest
request.- Parameters:
holder
- theCacheRequestHolder
containing theReplaceMappingRequest
request- Returns:
- a
CompletionStage
that completes with aBinary
containing the serialized result of executing theReplaceMappingRequest
request
-
size
public void size(com.oracle.coherence.grpc.SizeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Int32Value> observer) Description copied from interface:NamedCacheService
Determine the number of entries in a cache.- Specified by:
size
in interfaceNamedCacheService
- Parameters:
request
- theSizeRequest
to executeobserver
- theStreamObserver
that will receive the responses- See Also:
-
truncate
public void truncate(com.oracle.coherence.grpc.TruncateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheService
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, aCacheLifecycleEvent
is raised to notify subscribers of the execution of this operation.- Specified by:
truncate
in interfaceNamedCacheService
- Parameters:
request
- theTruncateRequest
containing the name of the cache to truncateobserver
- theStreamObserver
that will receive the responses
-
values
public void values(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute theValuesRequest
request passing the results to the providedStreamObserver
.- Specified by:
values
in interfaceNamedCacheService
- Parameters:
request
- theValuesRequest
observer
- theStreamObserver
which will receive the results- See Also:
-
values
protected Void values(CacheRequestHolder<com.oracle.coherence.grpc.ValuesRequest, Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute theValuesRequest
request passing the results to the providedStreamObserver
.- Parameters:
holder
- theCacheRequestHolder
containing theValuesRequest
observer
- theStreamObserver
which will receive the results- Returns:
- always returns
Void
-
convertKeys
protected CompletionStage<List<Binary>> convertKeys(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest, Void> holder) Convert the keys for aGetAllRequest
from the request's serialization format to the cache's serialization format.- Parameters:
holder
- theCacheRequestHolder
containing theGetAllRequest
containing the keys to convert- Returns:
- A
CompletionStage
that completes with the converted keys
-