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) Forwards to the inner client'sget(K)rather than inheritingInternalAvroStoreClient.get(Object), so that inner decorators such asStatTrackingStoreClientstill record their single-get metrics.CompletableFuture<byte[]>Forwards to the inner client'sgetRaw(String)so that inner decorators such asStatTrackingStoreClientstill record their schema-reader metrics.static <T> BiFunction<? super T,Throwable, ? extends T> getStatCallback(ClientStats clientStats, long startTimeInNS, int requestedKeyCount) Builds a single-key completion handler that records healthy/unhealthy client metrics.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, handlePreservingException, isProjectionFieldValidationEnabled, setClusterNameChangeListener, 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
decompressAndDeserialize, get, registerStoreConfigChangeListener, registerVersionSwitchListener
-
Constructor Details
-
StatTrackingStoreClient
public StatTrackingStoreClient(InternalAvroStoreClient<K, V> innerStoreClient, ClientConfig clientConfig)
-
-
Method Details
-
get
Description copied from class:DelegatingStoreClientForwards to the inner client'sget(K)rather than inheritingInternalAvroStoreClient.get(Object), so that inner decorators such asStatTrackingStoreClientstill record their single-get metrics.- Specified by:
getin interfaceAvroGenericStoreClient<K,V> - Overrides:
getin classDelegatingStoreClient<K,V> - Returns:
-
getRaw
Description copied from class:DelegatingStoreClientForwards to the inner client'sgetRaw(String)so that inner decorators such asStatTrackingStoreClientstill record their schema-reader metrics.- Overrides:
getRawin classDelegatingStoreClient<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, int requestedKeyCount) Builds a single-key completion handler that records healthy/unhealthy client metrics. Callers pass the number of keys originally requested; it feeds the key-count-bucket OTel dimension and the unhealthy-path recording. Every non-null value (including a map-valued record) represents one successful key for single-get and getRaw. -
handleStoreExceptionInternally
-
toString
-