Package com.linkedin.venice.fastclient
Class DualReadAvroGenericStoreClient<K,V>
java.lang.Object
com.linkedin.venice.fastclient.InternalAvroStoreClient<K,V>
com.linkedin.venice.fastclient.DelegatingAvroStoreClient<K,V>
com.linkedin.venice.fastclient.DualReadAvroGenericStoreClient<K,V>
- All Implemented Interfaces:
AvroGenericReadComputeStoreClient<K,
,V> AvroGenericStoreClient<K,
,V> Closeable
,AutoCloseable
- Direct Known Subclasses:
DualReadAvroSpecificStoreClient
The following class has capability to send dual read requests via Fast-client and Thin-client.
1. If both of them succeed, return the faster one.
2. If one of them fails, return the succeeded one.
3. If both of them fail, throw exception.
Currently, this implementation only supports dual-read for single-get and batch-get requests. Compute requests have
not been implemented for two reasons:
1. We prefer to do a gradual ramp of the feature as dual reads can lead to extra load on the storage nodes
2. The complexity of implementing dual reads for compute is higher and needs extra work to convert a
StreamingCallback
into a Future
.-
Constructor Summary
ModifierConstructorDescriptionDualReadAvroGenericStoreClient
(InternalAvroStoreClient<K, V> delegate, ClientConfig config) protected
DualReadAvroGenericStoreClient
(InternalAvroStoreClient<K, V> delegate, ClientConfig config, AvroGenericStoreClient<K, V> thinClient) -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletableFuture<V>
get
(GetRequestContext requestContext, K key) TODO both super.get(key) and super.get(ctx,key) fetches non map for vsonClient for the first request.Methods inherited from class com.linkedin.venice.fastclient.DelegatingAvroStoreClient
close, compute, compute, getClientConfig, getKeySchema, getLatestValueSchema, getSchemaReader, getStoreName, start, streamingBatchGet
Methods inherited from class com.linkedin.venice.fastclient.InternalAvroStoreClient
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
-
DualReadAvroGenericStoreClient
-
DualReadAvroGenericStoreClient
protected DualReadAvroGenericStoreClient(InternalAvroStoreClient<K, V> delegate, ClientConfig config, AvroGenericStoreClient<K, V> thinClient)
-
-
Method Details
-
get
protected CompletableFuture<V> get(GetRequestContext requestContext, K key) throws VeniceClientException TODO both super.get(key) and super.get(ctx,key) fetches non map for vsonClient for the first request. Needs to be investigated- Overrides:
get
in classDelegatingAvroStoreClient<K,
V> - Throws:
VeniceClientException
-
batchGet
public CompletableFuture<Map<K,V>> batchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys) throws VeniceClientException- Overrides:
batchGet
in classInternalAvroStoreClient<K,
V> - Throws:
VeniceClientException
-