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 Details

    • InternalAvroStoreClient

      public InternalAvroStoreClient()
  • Method Details

    • getRaw

      public CompletableFuture<byte[]> getRaw(String requestPath)
    • get

      public CompletableFuture<V> get(K key) throws VeniceClientException
      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 throw ExecutionException, which is a wrapper of the real exception.
      Specified by:
      get in interface AvroGenericStoreClient<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

      public Executor getDeserializationExecutor()
    • computeWithKeyPrefixFilter

      public void computeWithKeyPrefixFilter(byte[] keyPrefix, ComputeRequestWrapper computeRequestWrapper, StreamingCallback<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> callback)
      Specified by:
      computeWithKeyPrefixFilter in interface AvroGenericReadComputeStoreClient<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

      public void setClusterNameChangeListener(Consumer<String> listener)
      Wires a listener that receives the resolved Venice cluster name on initial discovery and on 301-redirect-driven store migrations.

      StatTrackingStoreClient uses this to push the venice.cluster.name metric dimension. DelegatingStoreClient propagates the call to its inner store client. AbstractAvroStoreClient stores the listener and fires it directly from discoverD2Service (initial); for migrations, it wires a redirect notifier on D2TransportClient that re-resolves cluster via D2ServiceDiscovery and 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)