Package com.linkedin.venice.fastclient
Class InternalAvroStoreClient<K,V>
java.lang.Object
com.linkedin.venice.fastclient.InternalAvroStoreClient<K,V>
- All Implemented Interfaces:
AvroGenericReadComputeStoreClient<K,,V> AvroGenericStoreClient<K,,V> Closeable,AutoCloseable
- Direct Known Subclasses:
DelegatingAvroStoreClient,DispatchingAvroGenericStoreClient
public abstract class InternalAvroStoreClient<K,V>
extends Object
implements AvroGenericReadComputeStoreClient<K,V>
All the internal implementations of different tiers should extend this class.
This class adds in
RequestContext object for the communication among different tiers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletableFuture<Map<K,V>> final CompletableFuture<Map<K,V>> Get the values associated with the given keys and return them in a map of keys to values.final voidcompute(ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, ComputeGenericRecord> callback, long preRequestTimeInNS) protected abstract voidcompute(ComputeRequestContext<K, V> requestContext, ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, ComputeGenericRecord> callback, long preRequestTimeInNS) final voidcomputeWithKeyPrefixFilter(byte[] keyPrefix, ComputeRequestWrapper computeRequestWrapper, StreamingCallback<org.apache.avro.generic.GenericRecord, org.apache.avro.generic.GenericRecord> callback) protected abstract CompletableFuture<V>get(GetRequestContext<K> requestContext, K key) Lookup the value by given key, and get(key).get() will return null if it doesn't exist.abstract ClientConfigfinal booleanprotected final CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys) protected abstract voidstreamingBatchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys, StreamingCallback<K, V> callback) final CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(Set<K> keys) Get the values associated with the given keys and return them in a map of keys to values.final voidstreamingBatchGet(Set<K> keys, StreamingCallback<K, V> callback) Streaming interface forAvroGenericStoreClient.batchGet(Set).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, computeAggregation, getSchemaReaderMethods inherited from interface com.linkedin.venice.client.store.AvroGenericStoreClient
close, get, getKeySchema, getLatestValueSchema, getStoreName, start
-
Constructor Details
-
InternalAvroStoreClient
public InternalAvroStoreClient()
-
-
Method Details
-
getClientConfig
-
isProjectionFieldValidationEnabled
public final boolean isProjectionFieldValidationEnabled()- Specified by:
isProjectionFieldValidationEnabledin interfaceAvroGenericReadComputeStoreClient<K,V>
-
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
protected abstract CompletableFuture<V> get(GetRequestContext<K> requestContext, K key) throws VeniceClientException - Throws:
VeniceClientException
-
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> - Returns:
- Throws:
VeniceClientException
-
batchGet
protected CompletableFuture<Map<K,V>> batchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys) throws VeniceClientException- Throws:
VeniceClientException
-
streamingBatchGet
public final 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> - Throws:
VeniceClientException
-
streamingBatchGet
public final 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.- Specified by:
streamingBatchGetin interfaceAvroGenericStoreClient<K,V> - Returns:
- Throws:
VeniceClientException
-
streamingBatchGet
protected final CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys) -
streamingBatchGet
protected abstract void streamingBatchGet(BatchGetRequestContext<K, V> requestContext, Set<K> keys, StreamingCallback<K, V> callback) -
compute
public final 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> - Throws:
VeniceClientException
-
compute
protected abstract void compute(ComputeRequestContext<K, V> requestContext, ComputeRequestWrapper computeRequestWrapper, Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K, throws VeniceClientExceptionComputeGenericRecord> callback, long preRequestTimeInNS) - Throws:
VeniceClientException
-
computeWithKeyPrefixFilter
public final void computeWithKeyPrefixFilter(byte[] keyPrefix, ComputeRequestWrapper computeRequestWrapper, StreamingCallback<org.apache.avro.generic.GenericRecord, org.apache.avro.generic.GenericRecord> callback) - Specified by:
computeWithKeyPrefixFilterin interfaceAvroGenericReadComputeStoreClient<K,V>
-