Package com.linkedin.venice.client.store
Class StatTrackingStoreClient<K,V>
java.lang.Object
com.linkedin.venice.client.store.InternalAvroStoreClient<K,V>
com.linkedin.venice.client.store.DelegatingStoreClient<K,V>
com.linkedin.venice.client.store.StatTrackingStoreClient<K,V>
- Type Parameters:
V
-
- All Implemented Interfaces:
AvroGenericReadComputeStoreClient<K,
,V> AvroGenericStoreClient<K,
,V> Closeable
,AutoCloseable
- Direct Known Subclasses:
SpecificStatTrackingStoreClient
This class is used to handle all the metric related logic.
-
Constructor Summary
ConstructorDescriptionStatTrackingStoreClient
(InternalAvroStoreClient<K, V> innerStoreClient, ClientConfig clientConfig) -
Method Summary
Modifier and TypeMethodDescriptionGet the values associated with the given keys and return them in a map of keys to values.compute()
This API allows performing transformations (projection, vector arithmetic and aggregations like count) on the values associated with the given set of keys.void
compute
(ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, ComputeGenericRecord> callback, long preRequestTimeInNS) Lookup the value by given key, and get(key).get() will return null if it doesn't exist.CompletableFuture<byte[]>
static <T> BiFunction<? super T,
Throwable, ? extends T> getStatCallback
(ClientStats clientStats, long startTimeInNS) static void
handleStoreExceptionInternally
(Throwable throwable) void
recordRetryCount
(RequestType requestType) streamingBatchGet
(Set<K> keys) Get the values associated with the given keys and return them in a map of keys to values.void
streamingBatchGet
(Set<K> keys, StreamingCallback<K, V> callback) Streaming interface forAvroGenericStoreClient.batchGet(Set)
.toString()
Methods inherited from class com.linkedin.venice.client.store.DelegatingStoreClient
close, compute, computeWithKeyPrefixFilter, get, getDeserializationExecutor, getInnerStoreClient, getKeySchema, getLatestValueSchema, getRaw, getSchemaReader, getStoreName, isProjectionFieldValidationEnabled, start
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linkedin.venice.client.store.AvroGenericReadComputeStoreClient
compute, compute
Methods inherited from interface com.linkedin.venice.client.store.AvroGenericStoreClient
get
-
Constructor Details
-
StatTrackingStoreClient
public StatTrackingStoreClient(InternalAvroStoreClient<K, V> innerStoreClient, ClientConfig clientConfig)
-
-
Method Details
-
get
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 classInternalAvroStoreClient<K,
V> - Returns:
-
getRaw
- Overrides:
getRaw
in classInternalAvroStoreClient<K,
V>
-
batchGet
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 classDelegatingStoreClient<K,
V> - Returns:
- Throws:
VeniceClientException
-
streamingBatchGet
public CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(Set<K> keys) throws VeniceClientException Description copied from interface:AvroGenericStoreClient
Get the values associated with the given keys and return them in a map of keys to values. When time-out happens for the following invocation:streamingBatchGet(keys).get(waitingTime, unit);
This function will return the available response instead of throwing aTimeoutException
. It means this function could return either full response or partial response.- Returns:
- Throws:
VeniceClientException
-
recordRetryCount
-
streamingBatchGet
public void streamingBatchGet(Set<K> keys, StreamingCallback<K, V> callback) throws VeniceClientExceptionDescription copied from interface:AvroGenericStoreClient
Streaming interface forAvroGenericStoreClient.batchGet(Set)
. You can find more info inStreamingCallback
.- Specified by:
streamingBatchGet
in interfaceAvroGenericStoreClient<K,
V> - Overrides:
streamingBatchGet
in classDelegatingStoreClient<K,
V> - Throws:
VeniceClientException
-
compute
public void compute(ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, ComputeGenericRecord> callback, long preRequestTimeInNS) throws VeniceClientException- Specified by:
compute
in interfaceAvroGenericReadComputeStoreClient<K,
V> - Overrides:
compute
in classDelegatingStoreClient<K,
V> - Throws:
VeniceClientException
-
compute
Description copied from interface:AvroGenericStoreClient
This API allows performing transformations (projection, vector arithmetic and aggregations like count) on the values associated with the given set of keys. Check outComputeRequestBuilder
for details on the available operations.- Throws:
VeniceClientException
- See Also:
-
getStatCallback
public static <T> BiFunction<? super T,Throwable, getStatCallback? extends T> (ClientStats clientStats, long startTimeInNS) -
handleStoreExceptionInternally
-
toString
-