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
ConstructorsConstructorDescriptionStatTrackingStoreClient(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.voidcompute(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 voidhandleStoreExceptionInternally(Throwable throwable) voidrecordRetryCount(RequestType requestType) streamingBatchGet(Set<K> keys) Get the values associated with the given keys and return them in a map of keys to values.voidstreamingBatchGet(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, startWithExceptionThrownWhenFailMethods inherited from class com.linkedin.venice.client.store.InternalAvroStoreClient
getStreamingCallbackMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.linkedin.venice.client.store.AvroGenericReadComputeStoreClient
compute, compute, computeAggregationMethods 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:AvroGenericStoreClientLookup 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:
getin interfaceAvroGenericStoreClient<K,V> - Overrides:
getin classInternalAvroStoreClient<K,V> - Returns:
-
getRaw
- Overrides:
getRawin classInternalAvroStoreClient<K,V>
-
batchGet
Description copied from interface:AvroGenericStoreClientGet 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:
batchGetin interfaceAvroGenericStoreClient<K,V> - Overrides:
batchGetin classDelegatingStoreClient<K,V> - Returns:
- Throws:
VeniceClientException
-
streamingBatchGet
public CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(Set<K> keys) throws VeniceClientException Description copied from interface:AvroGenericStoreClientGet 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:AvroGenericStoreClientStreaming interface forAvroGenericStoreClient.batchGet(Set). You can find more info inStreamingCallback.- Specified by:
streamingBatchGetin interfaceAvroGenericStoreClient<K,V> - Overrides:
streamingBatchGetin 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:
computein interfaceAvroGenericReadComputeStoreClient<K,V> - Overrides:
computein classDelegatingStoreClient<K,V> - Throws:
VeniceClientException
-
compute
Description copied from interface:AvroGenericStoreClientThis API allows performing transformations (projection, vector arithmetic and aggregations like count) on the values associated with the given set of keys. Check outComputeRequestBuilderfor 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
-