Package com.linkedin.venice.fastclient
Class RetriableAvroGenericStoreClient<K,V>
java.lang.Object
com.linkedin.venice.fastclient.InternalAvroStoreClient<K,V>
com.linkedin.venice.fastclient.DelegatingAvroStoreClient<K,V>
com.linkedin.venice.fastclient.RetriableAvroGenericStoreClient<K,V>
- All Implemented Interfaces:
AvroGenericReadComputeStoreClient<K,
,V> AvroGenericStoreClient<K,
,V> Closeable
,AutoCloseable
- Direct Known Subclasses:
RetriableAvroSpecificStoreClient
This class is mostly used to trigger retry in the following scenarios:
1. The original request latency exceeds the retry threshold.
2. The original request fails.
TODO:
1. Limit the retry volume.
2. Leverage some smart logic to avoid useless retry, such as retry triggered by heavy GC.
-
Constructor Summary
ConstructorDescriptionRetriableAvroGenericStoreClient
(InternalAvroStoreClient<K, V> delegate, ClientConfig clientConfig, TimeoutProcessor timeoutProcessor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Release the internal resources.void
compute
(ComputeRequestContext<K, V> requestContext, ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, ComputeGenericRecord> callback, long preRequestTimeInNS) protected CompletableFuture<V>
get
(GetRequestContext requestContext, K key) TODO: Limit the retry volume: Even though retry for a single request is being scheduled at max twice (once via scheduler (LONG_TAIL_RETRY) and once instant (ERROR_RETRY) if originalRequestFuture fails), there is no way to control the total allowed retry per node.void
streamingBatchGet
(BatchGetRequestContext<K, V> requestContext, Set<K> keys, StreamingCallback<K, V> callback) Methods inherited from class com.linkedin.venice.fastclient.DelegatingAvroStoreClient
compute, getClientConfig, getKeySchema, getLatestValueSchema, getSchemaReader, getStoreName, start
Methods inherited from class com.linkedin.venice.fastclient.InternalAvroStoreClient
batchGet, batchGet, compute, computeWithKeyPrefixFilter, get, isProjectionFieldValidationEnabled, streamingBatchGet, streamingBatchGet, streamingBatchGet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.venice.client.store.AvroGenericReadComputeStoreClient
compute, compute, compute
Methods inherited from interface com.linkedin.venice.client.store.AvroGenericStoreClient
get
-
Constructor Details
-
RetriableAvroGenericStoreClient
public RetriableAvroGenericStoreClient(InternalAvroStoreClient<K, V> delegate, ClientConfig clientConfig, TimeoutProcessor timeoutProcessor)
-
-
Method Details
-
get
protected CompletableFuture<V> get(GetRequestContext requestContext, K key) throws VeniceClientException TODO: Limit the retry volume: Even though retry for a single request is being scheduled at max twice (once via scheduler (LONG_TAIL_RETRY) and once instant (ERROR_RETRY) if originalRequestFuture fails), there is no way to control the total allowed retry per node. It would be good to design some mechanism to make it configurable, such as retry at most the slowest 5% of traffic, otherwise, too many retry requests could cause cascading failure.- Overrides:
get
in classDelegatingAvroStoreClient<K,
V> - Throws:
VeniceClientException
-
streamingBatchGet
public void streamingBatchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys, StreamingCallback<K, throws VeniceClientExceptionV> callback) - Overrides:
streamingBatchGet
in classDelegatingAvroStoreClient<K,
V> - Throws:
VeniceClientException
-
compute
public void compute(ComputeRequestContext<K, V> requestContext, ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, throws VeniceClientExceptionComputeGenericRecord> callback, long preRequestTimeInNS) - Overrides:
compute
in classDelegatingAvroStoreClient<K,
V> - Throws:
VeniceClientException
-
close
public void close()Description copied from interface:AvroGenericStoreClient
Release the internal resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceAvroGenericStoreClient<K,
V> - Specified by:
close
in interfaceCloseable
- Overrides:
close
in classDelegatingAvroStoreClient<K,
V>
-