Class Cache
java.lang.Object
org.apache.beam.io.requestresponse.Cache
Transforms for reading and writing request/response associations to a cache.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A simple POJO that holds both cache read and writePTransform
s. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <RequestT,
ResponseT>
Cache.Pair<RequestT, ResponseT> usingRedis
(URI uri, Coder<RequestT> requestTCoder, Coder<ResponseT> responseTCoder, Duration expiry)
-
Constructor Details
-
Cache
public Cache()
-
-
Method Details
-
usingRedis
public static <RequestT,ResponseT> Cache.Pair<RequestT,ResponseT> usingRedis(URI uri, Coder<RequestT> requestTCoder, Coder<ResponseT> responseTCoder, Duration expiry) throws Coder.NonDeterministicException Builds aCache.Pair
using a Redis cache to read and writeCache
andCache
pairs. The purpose of the cache is to offloadCache
s from the API and instead return theCache
if the association is known. Since theCache
s andCache
s need encoding and decoding, checks are made whether the requestTCoder and responseTCoders areCoder.verifyDeterministic()
. This feature is only appropriate for API reads such as HTTP list, get, etc.Below describes the parameters in more detail and their usage.
- Throws:
Coder.NonDeterministicException
-