Package com.linkedin.davinci.client
Class StatsAvroGenericDaVinciClient<K,V>
- java.lang.Object
-
- com.linkedin.davinci.client.DelegatingAvroGenericDaVinciClient<K,V>
-
- com.linkedin.davinci.client.StatsAvroGenericDaVinciClient<K,V>
-
- All Implemented Interfaces:
DaVinciClient<K,V>
,AvroGenericReadComputeStoreClient<K,V>
,AvroGenericStoreClient<K,V>
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
StatsAvroSpecificDaVinciClient
public class StatsAvroGenericDaVinciClient<K,V> extends DelegatingAvroGenericDaVinciClient<K,V>
Currently, we only expose metrics for single-get and batch-get requests, and if there is a need to have metrics for other request types, we can add them later. So far, it only offers very basic metrics: 1. Healthy request rate. 2. Unhealthy request rate. 3. Healthy request latency. 4. Key count for batch-get request. 5. Success request/key count ratio.
-
-
Constructor Summary
Constructors Constructor Description StatsAvroGenericDaVinciClient(AvroGenericDaVinciClient<K,V> delegate, ClientConfig clientConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.Map<K,V>>
batchGet(java.util.Set<K> keys)
Get the values associated with the given keys and return them in a map of keys to values.java.util.concurrent.CompletableFuture<V>
get(K key)
Lookup the value by given key, and get(key).get() will return null if it doesn't exist.java.util.concurrent.CompletableFuture<V>
get(K key, V reusableValue)
Similar toAvroGenericStoreClient.get(Object)
except that it allows passing in a {@param reusedValue} instance, to minimize GC.-
Methods inherited from class com.linkedin.davinci.client.DelegatingAvroGenericDaVinciClient
close, compute, compute, computeWithKeyPrefixFilter, getKeySchema, getLatestValueSchema, getPartitionCount, getSchemaReader, getStoreName, isProjectionFieldValidationEnabled, start, streamingBatchGet, subscribe, subscribeAll, unsubscribe, unsubscribeAll
-
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
streamingBatchGet
-
-
-
-
Constructor Detail
-
StatsAvroGenericDaVinciClient
public StatsAvroGenericDaVinciClient(AvroGenericDaVinciClient<K,V> delegate, ClientConfig clientConfig)
-
-
Method Detail
-
get
public java.util.concurrent.CompletableFuture<V> get(K key)
Description copied from interface:AvroGenericStoreClient
Lookup the value by given key, and get(key).get() will return null if it doesn't exist. For now, if any backend error/exception happens, get(Object key).get() will throwExecutionException
, which is a wrapper of the real exception.- Specified by:
get
in interfaceAvroGenericStoreClient<K,V>
- Overrides:
get
in classDelegatingAvroGenericDaVinciClient<K,V>
- Returns:
-
get
public java.util.concurrent.CompletableFuture<V> get(K key, V reusableValue)
Description copied from interface:AvroGenericStoreClient
Similar toAvroGenericStoreClient.get(Object)
except that it allows passing in a {@param reusedValue} instance, to minimize GC.- Specified by:
get
in interfaceAvroGenericStoreClient<K,V>
- Overrides:
get
in classDelegatingAvroGenericDaVinciClient<K,V>
-
batchGet
public java.util.concurrent.CompletableFuture<java.util.Map<K,V>> batchGet(java.util.Set<K> keys)
Description copied from interface:AvroGenericStoreClient
Get the values associated with the given keys and return them in a map of keys to values. Note that the returned map will only contain entries for the keys which have a value associated with them.- Specified by:
batchGet
in interfaceAvroGenericStoreClient<K,V>
- Overrides:
batchGet
in classDelegatingAvroGenericDaVinciClient<K,V>
- Returns:
-
-