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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRetriableAvroGenericStoreClient(InternalAvroStoreClient<K, V> delegate, ClientConfig clientConfig, TimeoutProcessor timeoutProcessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release the internal resources.protected voidcompute(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<K> 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.protected voidstreamingBatchGet(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, startMethods inherited from class com.linkedin.venice.fastclient.InternalAvroStoreClient
batchGet, batchGet, compute, computeWithKeyPrefixFilter, get, isProjectionFieldValidationEnabled, streamingBatchGet, streamingBatchGet, streamingBatchGetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.venice.client.store.AvroGenericReadComputeStoreClient
compute, compute, compute, computeAggregationMethods inherited from interface com.linkedin.venice.client.store.AvroGenericStoreClient
get
-
Field Details
-
SINGLE_KEY_LONG_TAIL_RETRY_STATS_PREFIX
- See Also:
-
MULTI_KEY_LONG_TAIL_RETRY_STATS_PREFIX
- See Also:
-
-
Constructor Details
-
RetriableAvroGenericStoreClient
public RetriableAvroGenericStoreClient(InternalAvroStoreClient<K, V> delegate, ClientConfig clientConfig, TimeoutProcessor timeoutProcessor)
-
-
Method Details
-
get
protected CompletableFuture<V> get(GetRequestContext<K> 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:
getin classDelegatingAvroStoreClient<K,V> - Throws:
VeniceClientException
-
streamingBatchGet
protected void streamingBatchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys, StreamingCallback<K, throws VeniceClientExceptionV> callback) - Overrides:
streamingBatchGetin classDelegatingAvroStoreClient<K,V> - Throws:
VeniceClientException
-
compute
protected void compute(ComputeRequestContext<K, V> requestContext, ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, throws VeniceClientExceptionComputeGenericRecord> callback, long preRequestTimeInNS) - Overrides:
computein classDelegatingAvroStoreClient<K,V> - Throws:
VeniceClientException
-
close
public void close()Description copied from interface:AvroGenericStoreClientRelease the internal resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceAvroGenericStoreClient<K,V> - Specified by:
closein interfaceCloseable- Overrides:
closein classDelegatingAvroStoreClient<K,V>
-