Package com.linkedin.venice.client.store
Class InternalAvroStoreClient<K,V>
java.lang.Object
com.linkedin.venice.client.store.InternalAvroStoreClient<K,V>
- All Implemented Interfaces:
AvroGenericReadComputeStoreClient<K,,V> AvroGenericStoreClient<K,,V> Closeable,AutoCloseable
- Direct Known Subclasses:
AbstractAvroStoreClient,DelegatingStoreClient
public abstract class InternalAvroStoreClient<K,V>
extends Object
implements AvroGenericReadComputeStoreClient<K,V>
This class includes some necessary functions to deal with certain metric-handling activities that only
the client implementation can be aware of. These metrics cannot be tracked from a purely-external
perspective (i.e.: from the
StatTrackingStoreClient's point of view).
It is intentional for these functions to not be part of AvroGenericStoreClient, so that the
end-user does not see these extra functions on the instances they get back from the
ClientFactory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeWithKeyPrefixFilter(byte[] keyPrefix, ComputeRequestWrapper computeRequestWrapper, StreamingCallback<org.apache.avro.generic.GenericRecord, org.apache.avro.generic.GenericRecord> callback) Lookup the value by given key, and get(key).get() will return null if it doesn't exist.abstract CompletableFuture<V>get(K key, Optional<ClientStats> stats, long preRequestTimeInNS) CompletableFuture<byte[]>abstract CompletableFuture<byte[]>getRaw(String requestPath, Optional<ClientStats> stats, long preRequestTimeInNS) getStreamingCallback(Set<K> keys, Map<K, V> resultMap, Queue<K> nonExistingKeys, CompletableFuture<VeniceResponseMap<K, V>> resultFuture) voidsetClusterNameChangeListener(Consumer<String> listener) Wires a listener that receives the resolved Venice cluster name on initial discovery and on 301-redirect-driven store migrations.abstract voidThis method is mainly for internal use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.venice.client.store.AvroGenericReadComputeStoreClient
compute, compute, compute, compute, compute, computeAggregation, getSchemaReader, isProjectionFieldValidationEnabledMethods inherited from interface com.linkedin.venice.client.store.AvroGenericStoreClient
batchGet, close, get, getKeySchema, getLatestValueSchema, getStoreName, start, streamingBatchGet, streamingBatchGet
-
Constructor Details
-
InternalAvroStoreClient
public InternalAvroStoreClient()
-
-
Method Details
-
getRaw
-
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> - Returns:
- Throws:
VeniceClientException
-
get
public abstract CompletableFuture<V> get(K key, Optional<ClientStats> stats, long preRequestTimeInNS) throws VeniceClientException - Throws:
VeniceClientException
-
getRaw
public abstract CompletableFuture<byte[]> getRaw(String requestPath, Optional<ClientStats> stats, long preRequestTimeInNS) -
getDeserializationExecutor
-
computeWithKeyPrefixFilter
public void computeWithKeyPrefixFilter(byte[] keyPrefix, ComputeRequestWrapper computeRequestWrapper, StreamingCallback<org.apache.avro.generic.GenericRecord, org.apache.avro.generic.GenericRecord> callback) - Specified by:
computeWithKeyPrefixFilterin interfaceAvroGenericReadComputeStoreClient<K,V>
-
startWithExceptionThrownWhenFail
public abstract void startWithExceptionThrownWhenFail()This method is mainly for internal use. The default {#start()} method will not throw an exception if the client fails to start since it is a best effort to make it compatible with the existing usage of the client (customers can trigger the start() method even before the dependency is ready). This method is mainly used to the internal startupAware callback, and it will indicate the startup failure by throwing an exception. -
setClusterNameChangeListener
Wires a listener that receives the resolved Venice cluster name on initial discovery and on 301-redirect-driven store migrations.StatTrackingStoreClientuses this to push thevenice.cluster.namemetric dimension.DelegatingStoreClientpropagates the call to its inner store client.AbstractAvroStoreClientstores the listener and fires it directly fromdiscoverD2Service(initial); for migrations, it wires a redirect notifier onD2TransportClientthat re-resolves cluster viaD2ServiceDiscoveryand forwards to the same listener. Default is a no-op for store clients without a D2-based transport. -
getStreamingCallback
public StreamingCallback<K,V> getStreamingCallback(Set<K> keys, Map<K, V> resultMap, Queue<K> nonExistingKeys, CompletableFuture<VeniceResponseMap<K, V>> resultFuture)
-