Package com.oracle.coherence.grpc
Class CacheRequestHolder<Req,Res> 
java.lang.Object
com.oracle.coherence.grpc.RequestHolder<Req,Res>
 
com.oracle.coherence.grpc.CacheRequestHolder<Req,Res> 
- Type Parameters:
- Req- the type of the request
- Res- the result type
A class that holds a gRPC request, an associated 
NamedCache
 and Binary converters.- Since:
- 20.06
- Author:
- Jonathan Knight 2019.11.21
- 
Nested Class SummaryNested classes/interfaces inherited from class com.oracle.coherence.grpc.RequestHolderRequestHolder.DownConverter, RequestHolder.ErrorHandlingConverter<F,T>, RequestHolder.UpConverter 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final AsyncNamedCache<Binary, Binary> TheAsyncNamedCachethat the request executes against.protected final Supplier<NamedCache<?, ?>> TheSupplierto use to obtain a non-pass-through cache.Fields inherited from class com.oracle.coherence.grpc.RequestHolderf_executor, f_request, f_serializer, f_service, f_sFormat, m_converterDown, m_converterUp, m_result
- 
Constructor SummaryConstructorsConstructorDescriptionCacheRequestHolder(Req request, AsyncNamedCache<Binary, Binary> cache, Supplier<NamedCache<?, ?>> cacheSupplier, String sFormat, Serializer serializer, Executor executor) Create aCacheRequestHolder.
- 
Method SummaryModifier and TypeMethodDescriptionbinaryConsumer(io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer) convertKeyDown(com.google.protobuf.ByteString bytes) Convert theByteStringdata serialized in the request format to aBinarykey serialized in the cache's serialization format.convertKeyDown(Binary binary) entryConsumer(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) Obtain theAsyncNamedCachethat the request executes on.getCache()Obtain theNamedCachethat the request executes on.Obtain the cache name.Obtain the cache'sSerializer.<K,V> NamedCache <K, V> Obtain theNamedCachethat the request executes on.<T> CompletionStage<CacheRequestHolder<Req, T>> runAsync(CompletionStage<T> stage) Return aCompletionStagethat will complete with a value of aRequestHolderwith a result value that is the result of the completion of the specifiedCompletionStage.Methods inherited from class com.oracle.coherence.grpc.RequestHolderconvertDown, convertDown, convertDown, convertUp, deserialize, deserializeRequest, deserializeToBytesValue, ensureConverterDown, ensureConverterUp, fromBinary, getCacheFormat, getDeserializedResult, getRequest, getResult, getSerializer, getServiceSerializer, setResult, toByteString, toBytesValue, toEntry, toEntryResult, toOptionalValue
- 
Field Details- 
f_asyncNamedCacheTheAsyncNamedCachethat the request executes against.
- 
f_cacheSupplierTheSupplierto use to obtain a non-pass-through cache.
- 
m_converterKeyDown
 
- 
- 
Constructor Details- 
CacheRequestHolderpublic CacheRequestHolder(Req request, AsyncNamedCache<Binary, Binary> cache, Supplier<NamedCache<?, ?>> cacheSupplier, String sFormat, Serializer serializer, Executor executor) Create aCacheRequestHolder.- Parameters:
- request- the cache request
- cache- the pass-through- AsyncNamedCachethat the request executes against
- cacheSupplier- the- Supplierto use to obtain a non-pass-through cache
- sFormat- the name of the serializer used to serialize the request payloads
- serializer- the- Serializerused by the request
- executor- the executor for asynchronous processing
 
 
- 
- 
Method Details- 
getCacheNameObtain the cache name.- Returns:
- the cache name
 
- 
getAsyncCacheObtain theAsyncNamedCachethat the request executes on.- Returns:
- the AsyncNamedCachethat the request executes on
 
- 
getCacheObtain theNamedCachethat the request executes on.- Returns:
- the NamedCachethat the request executes on
 
- 
getNonPassThruCacheObtain theNamedCachethat the request executes on.- Type Parameters:
- K- the key type
- V- the value type
- Returns:
- the NamedCachethat the request executes on
 
- 
getCacheSerializerObtain the cache'sSerializer.- Returns:
- the cache's Serializer
 
- 
convertKeyDownConvert theByteStringdata serialized in the request format to aBinarykey serialized in the cache's serialization format.- Parameters:
- bytes- the- ByteStringto convert
- Returns:
- a Binarykey in the cache's serialization format
 
- 
convertKeyDown
- 
ensureConverterKeyDownObtain theConverterused to convert between the request format keys and the cache format keys; creating theConverterif required.- Returns:
- the Converterused to convert between the request format keys and the cache format keys
 
- 
createConverterDownDescription copied from class:RequestHolder- Specified by:
- createConverterDownin class- RequestHolder<Req,- Res> 
- Returns:
- the Converterto use to convert from Object form to internalBinaryform
 
- 
runAsyncReturn aCompletionStagethat will complete with a value of aRequestHolderwith a result value that is the result of the completion of the specifiedCompletionStage.- Type Parameters:
- T- the type of the- CompletionStagevalue
- Parameters:
- stage- that stage that will provide the value for the- RequestHolder
- Returns:
- a CompletionStagethat completes with aRequestHolder
 
- 
entryConsumerpublic Consumer<Map.Entry<? extends Binary,? extends Binary>> entryConsumer(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer) 
- 
binaryConsumer
 
-