Class HelidonNamedCacheService
java.lang.Object
com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
com.oracle.coherence.grpc.proxy.common.BaseNamedCacheServiceImpl
com.oracle.coherence.grpc.proxy.helidon.HelidonNamedCacheService
- All Implemented Interfaces:
GrpcProxyService,NamedCacheService
public class HelidonNamedCacheService
extends BaseNamedCacheServiceImpl
implements NamedCacheService
A gRPC
NamedCacheService.- Author:
- Jonathan Knight 2024.02.08
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
BaseGrpcServiceImpl.DefaultDependencies, BaseGrpcServiceImpl.DependenciesNested 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_MESSAGEFields inherited from class com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
DEFAULT_TRANSFER_THRESHOLD, f_cacheFactorySupplier, f_dependencies, f_executor, f_metrics, f_serializerProducer, transferThreshold, VOIDFields inherited from interface com.oracle.coherence.grpc.proxy.common.NamedCacheService
SERVICE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionHelidonNamedCacheService(NamedCacheService.Dependencies dependencies) Create aHelidonNamedCacheService. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndex(com.oracle.coherence.grpc.AddIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Add an index to a cache.voidaggregate(com.oracle.coherence.grpc.AggregateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute anAggregateRequestagainst a cache and return the result serialized in aBytesValue.voidcontainsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Returnstrueif this map contains a mapping for the specified key to the specified value.voidcontainsKey(com.oracle.coherence.grpc.ContainsKeyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Returnstrueif this map contains a mapping for the specified key.voidcontainsValue(com.oracle.coherence.grpc.ContainsValueRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Returnstrueif this map contains a mapping for the specified value.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.voidget(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.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 the specified keys.voidinvoke(com.oracle.coherence.grpc.InvokeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) 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.protected voidinvokeAllWithFilter(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the filteredInvokeAllRequestrequest passing the results to the providedStreamObserver.protected voidinvokeAllWithKeys(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the key-basedInvokeAllRequestrequest passing the results to the providedStreamObserver.voidisEmpty(com.oracle.coherence.grpc.IsEmptyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Determine whether a cache is empty.voidisReady(com.oracle.coherence.grpc.IsReadyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) 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.static HelidonNamedCacheServiceCreate an instance ofHelidonNamedCacheServiceusing the default dependencies configuration.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.voidput(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.voidputAll(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.voidputIfAbsent(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.voidremove(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.voidremoveIndex(com.oracle.coherence.grpc.RemoveIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Remove an index from a cache.voidremoveMapping(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.voidreplace(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.voidreplaceMapping(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.voidsize(com.oracle.coherence.grpc.SizeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Int32Value> observer) Determine the number of entries in a cache.voidtruncate(com.oracle.coherence.grpc.TruncateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Removes all mappings from this map.voidvalues(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute theValuesRequestrequest 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, toBoolValueMethods inherited from class com.oracle.coherence.grpc.proxy.common.BaseGrpcServiceImpl
createDefaultExecutor, getExecutor, getMetrics, getSerializer, getTransferThresholdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.coherence.grpc.proxy.common.GrpcProxyService
getMetricsMethods inherited from interface com.oracle.coherence.grpc.proxy.common.NamedCacheService
clear, createRequestHolder, destroy, ensureFilter, events, getFilter
-
Constructor Details
-
HelidonNamedCacheService
Create aHelidonNamedCacheService.- Parameters:
dependencies- theNamedCacheService.Dependenciesto use to configure the service
-
-
Method Details
-
newInstance
Create an instance ofHelidonNamedCacheServiceusing the default dependencies configuration.- Parameters:
deps- theNamedCacheService.Dependenciesto use to create the service- Returns:
- an instance of
HelidonNamedCacheService
-
addIndex
public void addIndex(com.oracle.coherence.grpc.AddIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheServiceAdd an index to a cache.- Specified by:
addIndexin interfaceNamedCacheService- 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 indexobserver- theStreamObserverto 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:NamedCacheServiceExecute anAggregateRequestagainst a cache and return the result serialized in aBytesValue.- Specified by:
aggregatein interfaceNamedCacheService- Parameters:
request- theAggregateRequestto executeobserver- theStreamObserverto 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:NamedCacheServiceReturnstrueif this map contains a mapping for the specified key to the specified value.- Specified by:
containsEntryin interfaceNamedCacheService- Parameters:
request- the request which contains the key and value whose presence in this map is to be testedobserver- theStreamObserverto receive the response- See Also:
-
containsKey
public void containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheServiceReturnstrueif this map contains a mapping for the specified key.- Specified by:
containsKeyin interfaceNamedCacheService- Parameters:
request- the request which contains the key whose presence in this map is to be testedobserver- theStreamObserverto receive the response- See Also:
-
containsValue
public void containsValue(com.oracle.coherence.grpc.ContainsValueRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheServiceReturnstrueif this map contains a mapping for the specified value.- Specified by:
containsValuein interfaceNamedCacheService- Parameters:
request- the request which contains the value whose presence in this map is to be testedobserver- theStreamObserverto receive the response- See Also:
-
entrySet
public void entrySet(com.oracle.coherence.grpc.EntrySetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Description copied from interface:NamedCacheServiceStream a set of cache entries to aStreamObserver.- Specified by:
entrySetin interfaceNamedCacheService- Parameters:
request- theEntrySetRequestto executeobserver- theStreamObserverto stream the entries to- See Also:
-
get
public void get(com.oracle.coherence.grpc.GetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.OptionalValue> observer) Description copied from interface:NamedCacheServiceGet a value for a given key from a cache.- Specified by:
getin interfaceNamedCacheService- Parameters:
request- theGetRequestto executeobserver- theStreamObserverto receive events- See Also:
-
getAll
public void getAll(com.oracle.coherence.grpc.GetAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Description copied from interface:NamedCacheServiceObtain a stream of mappings of keys to values for all the specified keys.- Specified by:
getAllin interfaceNamedCacheService- Parameters:
request- theGetAllRequestrequest containing the cache name and collection of keys to obtain the mappings forobserver- theStreamObserverto stream the results back to
-
invoke
public void invoke(com.oracle.coherence.grpc.InvokeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheServiceInvoke anInvocableMap.EntryProcessoragainst an entry in a cache.- Specified by:
invokein interfaceNamedCacheService- Parameters:
request- theInvokeRequestcontaining the serialized key of the entry and the serializedInvocableMap.EntryProcessorobserver- theStreamObserverto stream the results back to
-
invokeAll
public void invokeAll(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Description copied from interface:NamedCacheServiceInvoke anInvocableMap.EntryProcessoragainst multiple entries in a cache.- Specified by:
invokeAllin interfaceNamedCacheService- Parameters:
request- theInvokeRequestcontaining the serialized keys or serializedFilterto use to identify the entries and the serializedInvocableMap.EntryProcessorobserver- theStreamObserverto observer the invocation results
-
invokeAllWithKeys
protected void invokeAllWithKeys(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the key-basedInvokeAllRequestrequest passing the results to the providedStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theInvokeAllRequestobserver- theStreamObserverwhich will receive the results
-
invokeAllWithFilter
protected void invokeAllWithFilter(CacheRequestHolder<com.oracle.coherence.grpc.InvokeAllRequest, Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Execute the filteredInvokeAllRequestrequest passing the results to the providedStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theInvokeAllRequestobserver- theStreamObserverwhich will receive the results
-
isEmpty
public void isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheServiceDetermine whether a cache is empty.- Specified by:
isEmptyin interfaceNamedCacheService- Parameters:
request- theIsEmptyRequestto executeobserver- theStreamObserverto 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:NamedCacheServiceDetermine whether a cache is Ready.- Specified by:
isReadyin interfaceNamedCacheService- Parameters:
request- theIsReadyRequestto executeobserver- theStreamObserverto 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:NamedCacheServiceStream a set of cache keys to aStreamObserver.- Specified by:
keySetin interfaceNamedCacheService- Parameters:
request- theKeySetRequestto executeobserver- theStreamObserverto stream the keys to- See Also:
-
nextKeySetPage
public void nextKeySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheServiceObtain the next page of a paged key set request.- Specified by:
nextKeySetPagein interfaceNamedCacheService- Parameters:
request- thePageRequestto executeobserver- theStreamObserverthat 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:NamedCacheServiceObtain the next page of a paged entry set request.- Specified by:
nextEntrySetPagein interfaceNamedCacheService- Parameters:
request- thePageRequestto executeobserver- theStreamObserverthat 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:NamedCacheServiceAssociate 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:
putin interfaceNamedCacheService- Parameters:
request- thePutRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
putAll
public void putAll(com.oracle.coherence.grpc.PutAllRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheServiceAdd 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:
putAllin interfaceNamedCacheService- Parameters:
request- thePutAllRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
putIfAbsent
public void putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheServiceIf 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:
putIfAbsentin interfaceNamedCacheService- Parameters:
request- thePutIfAbsentRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
remove
public void remove(com.oracle.coherence.grpc.RemoveRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheServiceRemove the mapping that is associated with the specified key.- Specified by:
removein interfaceNamedCacheService- Parameters:
request- theRemoveRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
removeIndex
public void removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer) Description copied from interface:NamedCacheServiceRemove an index from a cache.- Specified by:
removeIndexin interfaceNamedCacheService- Parameters:
request- theRemoveIndexRequestcontaining the name of the cache to remove the index from, the serializedValueExtractorthat was used to create the indexobserver- theStreamObserverthat 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:NamedCacheServiceRemove the mapping that is associated with the specified key only if the mapping exists in the cache.- Specified by:
removeMappingin interfaceNamedCacheService- Parameters:
request- theRemoveMappingRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
replace
public void replace(com.oracle.coherence.grpc.ReplaceRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Description copied from interface:NamedCacheServiceReplace the entry for the specified key only if it is currently mapped to some value.- Specified by:
replacein interfaceNamedCacheService- Parameters:
request- theReplaceRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
replaceMapping
public void replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer) Description copied from interface:NamedCacheServiceReplace the mapping for the specified key only if currently mapped to the specified value.- Specified by:
replaceMappingin interfaceNamedCacheService- Parameters:
request- theReplaceMappingRequestto executeobserver- theStreamObserverthat will receive the responses- See Also:
-
size
public void size(com.oracle.coherence.grpc.SizeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Int32Value> observer) Description copied from interface:NamedCacheServiceDetermine the number of entries in a cache.- Specified by:
sizein interfaceNamedCacheService- Parameters:
request- theSizeRequestto executeobserver- theStreamObserverthat 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:NamedCacheServiceRemoves 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.- Specified by:
truncatein interfaceNamedCacheService- Parameters:
request- theTruncateRequestcontaining the name of the cache to truncateobserver- theStreamObserverthat will receive the responses
-
values
public void values(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) Execute theValuesRequestrequest passing the results to the providedStreamObserver.- Specified by:
valuesin interfaceNamedCacheService- Parameters:
request- theValuesRequestobserver- theStreamObserverwhich will receive the results- See Also:
-