Class NamedCacheServiceImpl
- java.lang.Object
-
- com.oracle.coherence.grpc.proxy.BaseGrpcServiceImpl
-
- com.oracle.coherence.grpc.proxy.NamedCacheServiceImpl
-
- All Implemented Interfaces:
GrpcProxyService,NamedCacheService
public class NamedCacheServiceImpl extends BaseGrpcServiceImpl implements NamedCacheService
A gRPC NamedCache service.This class uses
AsyncNamedCacheand asynchronousCompletionStagewherever 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
CompletionStages is done using anDaemonPoolExecutorso as not to consume or block threads in the Fork Join Pool. TheDaemonPoolExecutoris 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.BaseGrpcServiceImpl
BaseGrpcServiceImpl.DefaultDependencies, BaseGrpcServiceImpl.Dependencies
-
Nested classes/interfaces inherited from interface com.oracle.coherence.grpc.proxy.NamedCacheService
NamedCacheService.DefaultDependencies, NamedCacheService.Dependencies
-
-
Field Summary
Fields Modifier and Type Field Description static StringMBEAN_NAMEThe name to use for the management MBean.-
Fields inherited from class com.oracle.coherence.grpc.proxy.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.NamedCacheService
SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description NamedCacheServiceImpl(NamedCacheService.Dependencies dependencies)Create aNamedCacheServiceImpl.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<com.google.protobuf.Empty>addIndex(com.oracle.coherence.grpc.AddIndexRequest request)Add an index to a cache.protected com.google.protobuf.EmptyaddIndex(CacheRequestHolder<com.oracle.coherence.grpc.AddIndexRequest,Void> holder)Execute theAddIndexRequestrequest.CompletionStage<com.google.protobuf.BytesValue>aggregate(com.oracle.coherence.grpc.AggregateRequest request)Execute anAggregateRequestagainst a cache and return the result serialized in aBytesValue.protected CompletionStage<com.google.protobuf.BytesValue>aggregateWithFilter(com.oracle.coherence.grpc.AggregateRequest request)Execute the filteredAggregateRequestrequest.protected CompletionStage<com.google.protobuf.BytesValue>aggregateWithFilter(CacheRequestHolder<com.oracle.coherence.grpc.AggregateRequest,Void> holder)Execute the filteredAggregateRequestrequest.protected CompletionStage<com.google.protobuf.BytesValue>aggregateWithKeys(com.oracle.coherence.grpc.AggregateRequest request)Execute the key-basedAggregateRequestrequest.protected CompletionStage<com.google.protobuf.BytesValue>aggregateWithKeys(CacheRequestHolder<com.oracle.coherence.grpc.AggregateRequest,Void> holder)Execute the filteredAggregateRequestrequest.protected InvocableMap.EntryProcessor<Binary,Binary,Binary>castProcessor(InvocableMap.EntryProcessor<Binary,Binary,?> ep)CompletionStage<com.google.protobuf.Empty>clear(com.oracle.coherence.grpc.ClearRequest request)Clear a cache.protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest,Binary>>containsEntry(CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest,Void> holder)Execute theContainsEntryRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of the contains entry request as a serialized Boolean.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.protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest,Boolean>>containsKey(CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest,Void> holder)Execute theContainsKeyRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of the contains key request.CompletionStage<com.google.protobuf.BoolValue>containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request)Returnstrueif 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 theContainsValueRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of the contains value request as a serialized Boolean.CompletionStage<com.google.protobuf.BoolValue>containsValue(com.oracle.coherence.grpc.ContainsValueRequest request)Returnstrueif 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 aGetAllRequestfrom the request's serialization format to the cache's serialization format.<Req> CompletionStage<CacheRequestHolder<Req,Void>>createHolderAsync(Req request, String sScope, String sCacheName, String format)Asynchronously create aCacheRequestHolderfor a given request.<Req> CacheRequestHolder<Req,Void>createRequestHolder(Req request, String sScope, String sCacheName, String format)Create aCacheRequestHolderfor a given request.<T> Comparator<T>deserializeComparator(com.google.protobuf.ByteString bytes, Serializer serializer)Obtain aComparatorfrom the serialized data in aByteString.CompletionStage<com.google.protobuf.Empty>destroy(com.oracle.coherence.grpc.DestroyRequest request)Destroy a cache.protected <V> com.google.protobuf.Emptyempty(V value)A helper method that always returnsEmpty.<T> Filter<T>ensureFilter(com.google.protobuf.ByteString bytes, Serializer serializer)Obtain aFilterfrom the serialized data in aByteString.ValueExtractor<?,?>ensureValueExtractor(com.google.protobuf.ByteString bytes, Serializer serializer)Obtain aValueExtractorfrom the serialized data in aByteString.protected VoidentrySet(CacheRequestHolder<com.oracle.coherence.grpc.EntrySetRequest,Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Execute theEntrySetRequestrequest and send the results to theStreamObserver.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.protected com.google.protobuf.Emptyexecute(Runnable task)Execute theRunnableand return anEmptyinstance.protected <T> Texecute(Callable<T> task)Execute theCallableand return the result.protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.GetRequest,Binary>>get(CacheRequestHolder<com.oracle.coherence.grpc.GetRequest,Void> holder)Execute theGetRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of theGetRequestrequest as a serialized Boolean.CompletionStage<com.oracle.coherence.grpc.OptionalValue>get(com.oracle.coherence.grpc.GetRequest request)Get a value for a given key from a cache.protected VoidgetAll(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest,Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Execute theGetAllRequestrequest and send the results to theStreamObserver.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.protected CompletionStage<AsyncNamedCache<Binary,Binary>>getAsyncCache(String scope, String cacheName)Obtain anAsyncNamedCache.protected NamedCache<Binary,Binary>getCache(String sScope, String sCacheName, boolean fPassThru)Obtain anNamedCache.protected ConfigurableCacheFactorygetCCF(String sScope)<T> Filter<T>getFilter(com.google.protobuf.ByteString bytes, Serializer serializer)Obtain aFilterfrom the serialized data in aByteString.protected NamedCache<Binary,Binary>getPassThroughCache(String scope, String cacheName)Obtain anNamedCache.protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest,Binary>>invoke(CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest,Void> holder)Execute theInvokeRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of theInvokeRequestrequest as a serialized Boolean.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.protected CompletionStage<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.protected CompletionStage<Void>invokeAllWithFilter(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)Execute the filteredInvokeAllRequestrequest 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-basedInvokeAllRequestrequest 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-basedInvokeAllRequestrequest passing the results to the providedStreamObserver.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.protected VoidkeySet(CacheRequestHolder<com.oracle.coherence.grpc.KeySetRequest,Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Execute the key-basedKeySetRequestrequest passing the results to the providedStreamObserver.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 NamedCacheServiceImplnewInstance()Create an instance ofNamedCacheServiceImplusing the default dependencies configuration.static NamedCacheServiceImplnewInstance(NamedCacheService.Dependencies deps)Create an instance ofNamedCacheServiceImplusing 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.protected CompletionStage<com.google.protobuf.Empty>partitionedPutAll(CacheRequestHolder<com.oracle.coherence.grpc.PutAllRequest,Void> holder, Map<Binary,Binary> map)Perform aputAlloperation on a partitioned cache.protected CompletionStage<com.google.protobuf.Empty>plainPutAll(AsyncNamedCache<Binary,Binary> cache, Map<Binary,Binary> map, long cMillis)Perform aputAlloperation on a partitioned cache.protected CompletionStage<com.google.protobuf.BytesValue>put(CacheRequestHolder<com.oracle.coherence.grpc.PutRequest,Void> holder)Execute a put request.CompletionStage<com.google.protobuf.BytesValue>put(com.oracle.coherence.grpc.PutRequest request)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.CompletionStage<com.google.protobuf.Empty>putAll(com.oracle.coherence.grpc.PutAllRequest request)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 aPutIfAbsentRequestrequest.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.protected CompletableFuture<Binary>remove(CacheRequestHolder<com.oracle.coherence.grpc.RemoveRequest,Void> holder)Execute aRemoveRequestrequest.CompletionStage<com.google.protobuf.BytesValue>remove(com.oracle.coherence.grpc.RemoveRequest request)Remove the mapping that is associated with the specified key.protected com.google.protobuf.EmptyremoveIndex(CacheRequestHolder<com.oracle.coherence.grpc.RemoveIndexRequest,Void> holder)Execute theRemoveIndexRequestrequest.CompletionStage<com.google.protobuf.Empty>removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request)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 theRemoveMappingRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of theRemoveMappingRequestrequest as a serialized Boolean.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.protected CompletableFuture<Binary>replace(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceRequest,Void> holder)Execute aReplaceRequestrequest.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.protected CompletableFuture<Binary>replaceMapping(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceMappingRequest,Void> holder)Execute aReplaceMappingRequestrequest.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.protected com.google.protobuf.BoolValuetoBoolValue(Binary binary, Serializer serializer)Deserialize aBinaryto a boolean value.CompletionStage<com.google.protobuf.Empty>truncate(com.oracle.coherence.grpc.TruncateRequest request)Removes all mappings from this map.protected Voidvalues(CacheRequestHolder<com.oracle.coherence.grpc.ValuesRequest,Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)Execute theValuesRequestrequest passing the results to the providedStreamObserver.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.BaseGrpcServiceImpl
createDefaultExecutor, getMetrics, getSerializer
-
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.GrpcProxyService
getMetrics
-
-
-
-
Field Detail
-
MBEAN_NAME
public static final String MBEAN_NAME
The name to use for the management MBean.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NamedCacheServiceImpl
public NamedCacheServiceImpl(NamedCacheService.Dependencies dependencies)
Create aNamedCacheServiceImpl.- Parameters:
dependencies- theNamedCacheService.Dependenciesto use to configure the service
-
-
Method Detail
-
newInstance
public static NamedCacheServiceImpl newInstance(NamedCacheService.Dependencies deps)
Create an instance ofNamedCacheServiceImplusing the default dependencies configuration.- Parameters:
deps- theNamedCacheService.Dependenciesto use to create the service- Returns:
- an instance of
NamedCacheServiceImpl
-
newInstance
public static NamedCacheServiceImpl newInstance()
Create an instance ofNamedCacheServiceImplusing the default dependencies configuration.- Returns:
- an instance of
NamedCacheServiceImpl
-
addIndex
public CompletionStage<com.google.protobuf.Empty> addIndex(com.oracle.coherence.grpc.AddIndexRequest request)
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 index- Returns:
- a
CompletionStagethat will complete when the index is created
-
addIndex
protected com.google.protobuf.Empty addIndex(CacheRequestHolder<com.oracle.coherence.grpc.AddIndexRequest,Void> holder)
Execute theAddIndexRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theAddIndexRequestrequest- Returns:
BinaryHelper.EMPTY
-
aggregate
public CompletionStage<com.google.protobuf.BytesValue> aggregate(com.oracle.coherence.grpc.AggregateRequest request)
Description copied from interface:NamedCacheServiceExecute anAggregateRequestagainst a cache and return the result serialized in aBytesValue.- Specified by:
aggregatein interfaceNamedCacheService- Parameters:
request- theAggregateRequestto execute- Returns:
- the serialized aggregation result
-
aggregateWithFilter
protected CompletionStage<com.google.protobuf.BytesValue> aggregateWithFilter(com.oracle.coherence.grpc.AggregateRequest request)
Execute the filteredAggregateRequestrequest.- Parameters:
request- theAggregateRequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized result of executing request
-
aggregateWithFilter
protected CompletionStage<com.google.protobuf.BytesValue> aggregateWithFilter(CacheRequestHolder<com.oracle.coherence.grpc.AggregateRequest,Void> holder)
Execute the filteredAggregateRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theContainsEntryRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized result of executing request
-
aggregateWithKeys
protected CompletionStage<com.google.protobuf.BytesValue> aggregateWithKeys(com.oracle.coherence.grpc.AggregateRequest request)
Execute the key-basedAggregateRequestrequest.- Parameters:
request- theAggregateRequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized result of executing request
-
aggregateWithKeys
protected CompletionStage<com.google.protobuf.BytesValue> aggregateWithKeys(CacheRequestHolder<com.oracle.coherence.grpc.AggregateRequest,Void> holder)
Execute the filteredAggregateRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theContainsEntryRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized result of executing request
-
clear
public CompletionStage<com.google.protobuf.Empty> clear(com.oracle.coherence.grpc.ClearRequest request)
Description copied from interface:NamedCacheServiceClear a cache.- Specified by:
clearin interfaceNamedCacheService- Parameters:
request- theClearRequestto execute- Returns:
- a
CompletionStagethat will complete when the cache has been cleared. - See Also:
NamedMap.clear()
-
containsEntry
public CompletionStage<com.google.protobuf.BoolValue> containsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request)
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 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)
-
containsEntry
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest,Binary>> containsEntry(CacheRequestHolder<com.oracle.coherence.grpc.ContainsEntryRequest,Void> holder)
Execute theContainsEntryRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of the contains entry request as a serialized Boolean.- Parameters:
holder- theCacheRequestHoldercontaining theContainsEntryRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized Boolean result of executing theContainsEntryRequestrequest
-
containsKey
public CompletionStage<com.google.protobuf.BoolValue> containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request)
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 tested- Returns:
- a
CompletionStagethat will complete with {code true} if this map contains a mapping for the specified key - See Also:
Map.containsKey(Object)
-
containsKey
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest,Boolean>> containsKey(CacheRequestHolder<com.oracle.coherence.grpc.ContainsKeyRequest,Void> holder)
Execute theContainsKeyRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of the contains key request.- Parameters:
holder- theCacheRequestHoldercontaining theContainsKeyRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the Boolean result of executing theContainsKeyRequestrequest
-
containsValue
public CompletionStage<com.google.protobuf.BoolValue> containsValue(com.oracle.coherence.grpc.ContainsValueRequest request)
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 tested- Returns:
- a
CompletionStagethat will complete with {code true} if this map contains a mapping for the specified value - See Also:
Map.containsKey(Object)
-
containsValue
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.ContainsValueRequest,Integer>> containsValue(CacheRequestHolder<com.oracle.coherence.grpc.ContainsValueRequest,Void> holder)
Execute theContainsValueRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of the contains value request as a serialized Boolean.- Parameters:
holder- theCacheRequestHoldercontaining theContainsValueRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized Boolean result of executing theContainsValueRequestrequest
-
destroy
public CompletionStage<com.google.protobuf.Empty> destroy(com.oracle.coherence.grpc.DestroyRequest request)
Description copied from interface:NamedCacheServiceDestroy a cache.- Specified by:
destroyin interfaceNamedCacheService- Parameters:
request- theDestroyRequestcontaining the name of the cache to destroy- Returns:
- a
CompletionStagethat will complete when the cache is destroyed
-
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:
QueryMap.entrySet(com.tangosol.util.Filter),QueryMap.entrySet(com.tangosol.util.Filter, java.util.Comparator)
-
entrySet
protected Void entrySet(CacheRequestHolder<com.oracle.coherence.grpc.EntrySetRequest,Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
Execute theEntrySetRequestrequest and send the results to theStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theEntrySetRequestrequestobserver- theStreamObserverwhich will receive results- Returns:
- always return
Void
-
events
public io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerRequest> events(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerResponse> observer)
Description copied from interface:NamedCacheServiceAdd aMapListenerto a cache and stream the events received to theStreamObserver.- Specified by:
eventsin interfaceNamedCacheService- Parameters:
observer- theStreamObserverto receive events- Returns:
- a
StreamObserverthat will be closed by the client to end event subscription
-
get
public CompletionStage<com.oracle.coherence.grpc.OptionalValue> get(com.oracle.coherence.grpc.GetRequest request)
Description copied from interface:NamedCacheServiceGet a value for a given key from a cache.- Specified by:
getin interfaceNamedCacheService- Parameters:
request- theGetRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.get(Object) - See Also:
Map.get(Object)
-
get
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.GetRequest,Binary>> get(CacheRequestHolder<com.oracle.coherence.grpc.GetRequest,Void> holder)
Execute theGetRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of theGetRequestrequest as a serialized Boolean.- Parameters:
holder- theCacheRequestHoldercontaining theGetRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized Binary result of executing theGetRequestrequest
-
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 of 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
-
getAll
protected Void getAll(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest,Void> holder, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
Execute theGetAllRequestrequest and send the results to theStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theGetAllRequestrequestobserver- theStreamObserverwhich will receive results- Returns:
- always return
Void
-
convertKeys
protected CompletionStage<List<Binary>> convertKeys(CacheRequestHolder<com.oracle.coherence.grpc.GetAllRequest,Void> holder)
Convert the keys for aGetAllRequestfrom the request's serialization format to the cache's serialization format.- Parameters:
holder- theCacheRequestHoldercontaining theGetAllRequestcontaining the keys to convert- Returns:
- A
CompletionStagethat completes with the converted keys
-
invoke
public CompletionStage<com.google.protobuf.BytesValue> invoke(com.oracle.coherence.grpc.InvokeRequest request)
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.EntryProcessor- Returns:
- the serialized result of the
InvocableMap.EntryProcessorinvocation
-
invoke
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest,Binary>> invoke(CacheRequestHolder<com.oracle.coherence.grpc.InvokeRequest,Void> holder)
Execute theInvokeRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of theInvokeRequestrequest as a serialized Boolean.- Parameters:
holder- theCacheRequestHoldercontaining theInvokeRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized Binary result of executing theInvokeRequestrequest
-
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
-
invokeAllWithFilter
protected CompletionStage<Void> invokeAllWithFilter(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
Execute the filteredInvokeAllRequestrequest passing the results to the providedStreamObserver.- Parameters:
request- theInvokeAllRequestobserver- theStreamObserverwhich will receive the results- Returns:
- always returns a
CompletionStagereturningVoid
-
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 filteredInvokeAllRequestrequest passing the results to the providedStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theInvokeAllRequestobserver- theStreamObserverwhich will receive the results- Returns:
- always returns a
CompletionStagereturningVoid
-
invokeAllWithKeys
protected CompletionStage<Void> invokeAllWithKeys(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
Execute the key-basedInvokeAllRequestrequest passing the results to the providedStreamObserver.- Parameters:
request- theInvokeAllRequestobserver- theStreamObserverwhich will receive the results- Returns:
- always returns a
CompletionStagereturningVoid
-
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-basedInvokeAllRequestrequest passing the results to the providedStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theInvokeAllRequestobserver- theStreamObserverwhich will receive the results- Returns:
- always returns a
CompletionStagereturningVoid
-
isEmpty
public CompletionStage<com.google.protobuf.BoolValue> isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request)
Description copied from interface:NamedCacheServiceDetermine whether a cache is empty.- Specified by:
isEmptyin interfaceNamedCacheService- Parameters:
request- theIsEmptyRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.isEmpty() - See Also:
Map.isEmpty()
-
isReady
public CompletionStage<com.google.protobuf.BoolValue> isReady(com.oracle.coherence.grpc.IsReadyRequest request)
Description copied from interface:NamedCacheServiceDetermine whether a cache is Ready.- Specified by:
isReadyin interfaceNamedCacheService- Parameters:
request- theIsReadyRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theNamedMap.isReady() - See Also:
NamedMap.isReady()
-
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:
QueryMap.keySet(com.tangosol.util.Filter)
-
keySet
protected Void keySet(CacheRequestHolder<com.oracle.coherence.grpc.KeySetRequest,Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
Execute the key-basedKeySetRequestrequest passing the results to the providedStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theKeySetRequestobserver- theStreamObserverwhich 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: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 CompletionStage<com.google.protobuf.BytesValue> put(com.oracle.coherence.grpc.PutRequest request)
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 execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.put(Object, Object) - See Also:
Map.put(Object, Object)
-
put
protected CompletionStage<com.google.protobuf.BytesValue> put(CacheRequestHolder<com.oracle.coherence.grpc.PutRequest,Void> holder)
Execute a put request.- Parameters:
holder- theCacheRequestHoldercontaining thePutRequestrequest- Returns:
- a
CompletionStagethat completes with aBytesValuecontaining the serialized result of executing thePutRequestrequest
-
putAll
public CompletionStage<com.google.protobuf.Empty> putAll(com.oracle.coherence.grpc.PutAllRequest request)
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 execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.putAll(java.util.Map) - See Also:
Map.putAll(java.util.Map)
-
putAll
protected CompletionStage<com.google.protobuf.Empty> putAll(CacheRequestHolder<com.oracle.coherence.grpc.PutAllRequest,Void> holder)
Execute a putAll request.- Parameters:
holder- theCacheRequestHoldercontaining thePutAllRequestrequest- Returns:
- a
CompletionStagethat completes after executing thePutAllRequestrequest
-
partitionedPutAll
protected CompletionStage<com.google.protobuf.Empty> partitionedPutAll(CacheRequestHolder<com.oracle.coherence.grpc.PutAllRequest,Void> holder, Map<Binary,Binary> map)
Perform aputAlloperation on a partitioned cache.This method will split the map of entries into a map per storage member and execute the putAll invocation for each member separately. This is more efficient than sending the map of entries to all members.
- Parameters:
holder- theCacheRequestHoldercontaining thePutAllRequestrequestmap- the map ofBinarykeys and values to put into the cache- Returns:
- a
CompletionStagethat completes when the putAll operation completes
-
plainPutAll
protected CompletionStage<com.google.protobuf.Empty> plainPutAll(AsyncNamedCache<Binary,Binary> cache, Map<Binary,Binary> map, long cMillis)
Perform aputAlloperation on a partitioned cache.- Parameters:
cache- theAsyncNamedCacheto updatemap- the map ofBinarykeys and values to put into the cachecMillis- the expiry delay to set on the entries- Returns:
- a
CompletionStagethat completes when theputAlloperation completes
-
putIfAbsent
public CompletionStage<com.google.protobuf.BytesValue> putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request)
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 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)
-
putIfAbsent
protected CompletableFuture<com.google.protobuf.BytesValue> putIfAbsent(CacheRequestHolder<com.oracle.coherence.grpc.PutIfAbsentRequest,Void> holder)
Execute aPutIfAbsentRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining thePutIfAbsentRequestrequest- Returns:
- a
CompletionStagethat completes with aBytesValuecontaining the serialized result of executing thePutIfAbsentRequestrequest
-
remove
public CompletionStage<com.google.protobuf.BytesValue> remove(com.oracle.coherence.grpc.RemoveRequest request)
Description copied from interface:NamedCacheServiceRemove the mapping that is associated with the specified key.- Specified by:
removein interfaceNamedCacheService- 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)
-
remove
protected CompletableFuture<Binary> remove(CacheRequestHolder<com.oracle.coherence.grpc.RemoveRequest,Void> holder)
Execute aRemoveRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theRemoveRequestrequest- Returns:
- a
CompletionStagethat completes with aBinarycontaining the serialized result of executing theRemoveRequestrequest
-
removeIndex
public CompletionStage<com.google.protobuf.Empty> removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request)
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 index- Returns:
- a
CompletionStagethat will complete when the index is removed
-
removeIndex
protected com.google.protobuf.Empty removeIndex(CacheRequestHolder<com.oracle.coherence.grpc.RemoveIndexRequest,Void> holder)
Execute theRemoveIndexRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theRemoveIndexRequestrequest- Returns:
BinaryHelper.EMPTY
-
removeMapping
public CompletionStage<com.google.protobuf.BoolValue> removeMapping(com.oracle.coherence.grpc.RemoveMappingRequest request)
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 execute- Returns:
- a
CompletionStagethat will complete withtrueif the removal was successful,falseotherwise - See Also:
Map.remove(Object, Object)
-
removeMapping
protected CompletionStage<CacheRequestHolder<com.oracle.coherence.grpc.RemoveMappingRequest,Boolean>> removeMapping(CacheRequestHolder<com.oracle.coherence.grpc.RemoveMappingRequest,Void> holder)
Execute theRemoveMappingRequestrequest and return aCompletionStagethat will complete when theAsyncNamedCacherequest completes and will contain aCacheRequestHolderholding the result of theRemoveMappingRequestrequest as a serialized Boolean.- Parameters:
holder- theCacheRequestHoldercontaining theRemoveMappingRequestrequest- Returns:
- a
CompletionStagethat completes with aCacheRequestHoldercontaining the serialized Binary result of executing theRemoveMappingRequestrequest
-
replace
public CompletionStage<com.google.protobuf.BytesValue> replace(com.oracle.coherence.grpc.ReplaceRequest request)
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 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)
-
replace
protected CompletableFuture<Binary> replace(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceRequest,Void> holder)
Execute aReplaceRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theReplaceRequestrequest- Returns:
- a
CompletionStagethat completes with aBinarycontaining the serialized result of executing theReplaceRequestrequest
-
replaceMapping
public CompletionStage<com.google.protobuf.BoolValue> replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request)
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 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)
-
replaceMapping
protected CompletableFuture<Binary> replaceMapping(CacheRequestHolder<com.oracle.coherence.grpc.ReplaceMappingRequest,Void> holder)
Execute aReplaceMappingRequestrequest.- Parameters:
holder- theCacheRequestHoldercontaining theReplaceMappingRequestrequest- Returns:
- a
CompletionStagethat completes with aBinarycontaining the serialized result of executing theReplaceMappingRequestrequest
-
size
public CompletionStage<com.google.protobuf.Int32Value> size(com.oracle.coherence.grpc.SizeRequest request)
Description copied from interface:NamedCacheServiceDetermine the number of entries in a cache.- Specified by:
sizein interfaceNamedCacheService- Parameters:
request- theSizeRequestto execute- Returns:
- a
CompletionStagethat will complete with the result of theMap.size() - See Also:
Map.size()
-
truncate
public CompletionStage<com.google.protobuf.Empty> truncate(com.oracle.coherence.grpc.TruncateRequest request)
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 truncate- Returns:
- a
CompletionStagethat completes when the truncate operation has completed
-
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:
QueryMap.values(com.tangosol.util.Filter),QueryMap.values(com.tangosol.util.Filter, java.util.Comparator)
-
values
protected Void values(CacheRequestHolder<com.oracle.coherence.grpc.ValuesRequest,Void> holder, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
Execute theValuesRequestrequest passing the results to the providedStreamObserver.- Parameters:
holder- theCacheRequestHoldercontaining theValuesRequestobserver- theStreamObserverwhich will receive the results- Returns:
- always returns
Void
-
empty
protected <V> com.google.protobuf.Empty empty(V value)
A helper method that always returnsEmpty.This method is to make
CompletionStagehandler code a little more elegant as it can use this method as a method reference.- Type Parameters:
V- the type of the value- Parameters:
value- the value- Returns:
- an
Emptyinstance.
-
execute
protected com.google.protobuf.Empty execute(Runnable task)
Execute theRunnableand return anEmptyinstance.- Parameters:
task- the runnable to execute- Returns:
- always returns an
Emptyinstance
-
execute
protected <T> T execute(Callable<T> task)
Execute theCallableand return the result.- Type Parameters:
T- the result type- Parameters:
task- the runnable to execute- Returns:
- the result of executing the
Callable
-
toBoolValue
protected com.google.protobuf.BoolValue toBoolValue(Binary binary, Serializer serializer)
Deserialize aBinaryto a boolean value.- Parameters:
binary- theBinaryto deserializeserializer- theSerializerto use- Returns:
- the deserialized boolean value
-
ensureValueExtractor
public ValueExtractor<?,?> ensureValueExtractor(com.google.protobuf.ByteString bytes, Serializer serializer)
Obtain aValueExtractorfrom the serialized data in aByteString.- Parameters:
bytes- theByteStringcontaining the serializedValueExtractorserializer- the serializer to use- Returns:
- a deserialized
ValueExtractor - Throws:
io.grpc.StatusRuntimeException- if theByteStringis null or empty
-
ensureFilter
public <T> Filter<T> ensureFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
Obtain aFilterfrom the serialized data in aByteString.If the
ByteStringisnullorByteString.EMPTYthen anAlwaysFilteris returned.- Specified by:
ensureFilterin interfaceNamedCacheService- Type Parameters:
T- theFiltertype- Parameters:
bytes- theByteStringcontaining the serializedFilterserializer- the serializer to use- Returns:
- a deserialized
Filter
-
getFilter
public <T> Filter<T> getFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
Obtain aFilterfrom the serialized data in aByteString.- Specified by:
getFilterin interfaceNamedCacheService- Type Parameters:
T- theFiltertype- Parameters:
bytes- theByteStringcontaining the serializedFilterserializer- the serializer to use- Returns:
- a deserialized
Filterornullif no filter is set
-
deserializeComparator
public <T> Comparator<T> deserializeComparator(com.google.protobuf.ByteString bytes, Serializer serializer)
Obtain aComparatorfrom the serialized data in aByteString.- Type Parameters:
T- theComparatortype- Parameters:
bytes- theByteStringcontaining the serializedComparatorserializer- the serializer to use- Returns:
- a deserialized
Comparatorornullif theByteStringisnullorByteString.EMPTY
-
getAsyncCache
protected CompletionStage<AsyncNamedCache<Binary,Binary>> getAsyncCache(String scope, String cacheName)
Obtain anAsyncNamedCache.- Parameters:
scope- the scope name to use to obtain the CCF to get the cache fromcacheName- the name of the cache- Returns:
- the
AsyncNamedCachewith the specified name
-
getPassThroughCache
protected NamedCache<Binary,Binary> getPassThroughCache(String scope, String cacheName)
Obtain anNamedCache.- Parameters:
scope- the scope name to use to obtain the CCF to get the cache fromcacheName- the name of the cache- Returns:
- the
NamedCachewith the specified name
-
getCCF
protected ConfigurableCacheFactory getCCF(String sScope)
-
getCache
protected NamedCache<Binary,Binary> getCache(String sScope, String sCacheName, boolean fPassThru)
Obtain anNamedCache.- Parameters:
sScope- the scope name to use to obtain the CCF to get the cache fromsCacheName- the name of the cachefPassThru-trueto use a binary pass-thru cache- Returns:
- the
NamedCachewith the specified name
-
castProcessor
protected InvocableMap.EntryProcessor<Binary,Binary,Binary> castProcessor(InvocableMap.EntryProcessor<Binary,Binary,?> ep)
- Parameters:
ep- theInvocableMap.EntryProcessorto cast- Returns:
- a
InvocableMap.EntryProcessorthat returns aBinaryresult
-
createHolderAsync
public <Req> CompletionStage<CacheRequestHolder<Req,Void>> createHolderAsync(Req request, String sScope, String sCacheName, String format)
Asynchronously 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:
- a
CompletionStagethat completes when theCacheRequestHolderhas been created
-
createRequestHolder
public <Req> CacheRequestHolder<Req,Void> createRequestHolder(Req request, String sScope, String sCacheName, String format)
Create aCacheRequestHolderfor a given request.- Specified by:
createRequestHolderin interfaceNamedCacheService- 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
-
-