Package com.oracle.coherence.grpc.v0
Class CacheRequestHolder<Req,Res>
java.lang.Object
com.oracle.coherence.grpc.v0.RequestHolder<Req,Res>
com.oracle.coherence.grpc.v0.CacheRequestHolder<Req,Res>
- Type Parameters:
Req- the type of the requestRes- 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 Summary
Nested classes/interfaces inherited from class com.oracle.coherence.grpc.v0.RequestHolder
RequestHolder.DownConverter, RequestHolder.ErrorHandlingConverter<F,T>, RequestHolder.UpConverter -
Field Summary
FieldsModifier 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.v0.RequestHolder
f_executor, f_request, f_serializer, f_service, f_sFormat, m_converterDown, m_converterUp, m_result -
Constructor Summary
ConstructorsConstructorDescriptionCacheRequestHolder(Req request, AsyncNamedCache<Binary, Binary> cache, Supplier<NamedCache<?, ?>> cacheSupplier, String sFormat, Serializer serializer, Executor executor) Create aCacheRequestHolder. -
Method Summary
Modifier 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.messages.cache.v0.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.v0.RequestHolder
convertDown, convertDown, convertDown, convertUp, deserialize, deserializeRequest, deserializeToBytesValue, ensureConverterDown, ensureConverterUp, fromBinary, getCacheFormat, getDeserializedResult, getRequest, getResult, getSerializer, getServiceSerializer, setResult, toByteString, toBytesValue, toEntry, toEntryResult, toOptionalValue
-
Field Details
-
f_asyncNamedCache
TheAsyncNamedCachethat the request executes against. -
f_cacheSupplier
TheSupplierto use to obtain a non-pass-through cache. -
m_converterKeyDown
-
-
Constructor Details
-
CacheRequestHolder
public CacheRequestHolder(Req request, AsyncNamedCache<Binary, Binary> cache, Supplier<NamedCache<?, ?>> cacheSupplier, String sFormat, Serializer serializer, Executor executor) Create aCacheRequestHolder.- Parameters:
request- the cache requestcache- the pass-throughAsyncNamedCachethat the request executes againstcacheSupplier- theSupplierto use to obtain a non-pass-through cachesFormat- the name of the serializer used to serialize the request payloadsserializer- theSerializerused by the requestexecutor- the executor for asynchronous processing
-
-
Method Details
-
getCacheName
Obtain the cache name.- Returns:
- the cache name
-
getAsyncCache
Obtain theAsyncNamedCachethat the request executes on.- Returns:
- the
AsyncNamedCachethat the request executes on
-
getCache
Obtain theNamedCachethat the request executes on.- Returns:
- the
NamedCachethat the request executes on
-
getNonPassThruCache
Obtain theNamedCachethat the request executes on.- Type Parameters:
K- the key typeV- the value type- Returns:
- the
NamedCachethat the request executes on
-
getCacheSerializer
Obtain the cache'sSerializer.- Returns:
- the cache's
Serializer
-
convertKeyDown
Convert theByteStringdata serialized in the request format to aBinarykey serialized in the cache's serialization format.- Parameters:
bytes- theByteStringto convert- Returns:
- a
Binarykey in the cache's serialization format
-
convertKeyDown
-
ensureConverterKeyDown
Obtain 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
-
createConverterDown
Description copied from class:RequestHolder- Specified by:
createConverterDownin classRequestHolder<Req,Res> - Returns:
- the
Converterto use to convert from Object form to internalBinaryform
-
runAsync
Return 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 theCompletionStagevalue- Parameters:
stage- that stage that will provide the value for theRequestHolder- Returns:
- a
CompletionStagethat completes with aRequestHolder
-
entryConsumer
public Consumer<Map.Entry<? extends Binary,? extends Binary>> entryConsumer(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.messages.cache.v0.Entry> observer) -
binaryConsumer
-