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>
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
DelegatingAvroStoreClient
,DispatchingAvroGenericStoreClient
public abstract class InternalAvroStoreClient<K,V> extends java.lang.Object implements AvroGenericReadComputeStoreClient<K,V>
All the internal implementations of different tiers should extend this class. This class adds inRequestContext
object for the communication among different tiers.
-
-
Constructor Summary
Constructors Constructor Description InternalAvroStoreClient()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.CompletableFuture<java.util.Map<K,V>>
batchGet(BatchGetRequestContext<K,V> requestContext, java.util.Set<K> keys)
java.util.concurrent.CompletableFuture<java.util.Map<K,V>>
batchGet(java.util.Set<K> keys)
Get the values associated with the given keys and return them in a map of keys to values.void
compute(ComputeRequestWrapper computeRequestWrapper, java.util.Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K,ComputeGenericRecord> callback, long preRequestTimeInNS)
protected abstract void
compute(ComputeRequestContext<K,V> requestContext, ComputeRequestWrapper computeRequestWrapper, java.util.Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K,ComputeGenericRecord> callback, long preRequestTimeInNS)
void
computeWithKeyPrefixFilter(byte[] keyPrefix, ComputeRequestWrapper computeRequestWrapper, StreamingCallback<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> callback)
protected abstract java.util.concurrent.CompletableFuture<V>
get(GetRequestContext requestContext, K key)
java.util.concurrent.CompletableFuture<V>
get(K key)
Lookup the value by given key, and get(key).get() will return null if it doesn't exist.abstract ClientConfig
getClientConfig()
boolean
isProjectionFieldValidationEnabled()
protected java.util.concurrent.CompletableFuture<VeniceResponseMap<K,V>>
streamingBatchGet(BatchGetRequestContext<K,V> requestContext, java.util.Set<K> keys)
protected abstract void
streamingBatchGet(BatchGetRequestContext<K,V> requestContext, java.util.Set<K> keys, StreamingCallback<K,V> callback)
java.util.concurrent.CompletableFuture<VeniceResponseMap<K,V>>
streamingBatchGet(java.util.Set<K> keys)
Get the values associated with the given keys and return them in a map of keys to values.void
streamingBatchGet(java.util.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, wait
-
Methods inherited from interface com.linkedin.venice.client.store.AvroGenericReadComputeStoreClient
compute, compute, compute, compute, getSchemaReader
-
Methods inherited from interface com.linkedin.venice.client.store.AvroGenericStoreClient
close, get, getKeySchema, getLatestValueSchema, getStoreName, start
-
-
-
-
Method Detail
-
getClientConfig
public abstract ClientConfig getClientConfig()
-
isProjectionFieldValidationEnabled
public final boolean isProjectionFieldValidationEnabled()
- Specified by:
isProjectionFieldValidationEnabled
in interfaceAvroGenericReadComputeStoreClient<K,V>
-
get
public java.util.concurrent.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 throwExecutionException
, which is a wrapper of the real exception.- Specified by:
get
in interfaceAvroGenericStoreClient<K,V>
- Returns:
- Throws:
VeniceClientException
-
get
protected abstract java.util.concurrent.CompletableFuture<V> get(GetRequestContext requestContext, K key) throws VeniceClientException
- Throws:
VeniceClientException
-
batchGet
public final java.util.concurrent.CompletableFuture<java.util.Map<K,V>> batchGet(java.util.Set<K> keys) throws VeniceClientException
Description copied from interface:AvroGenericStoreClient
Get 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:
batchGet
in interfaceAvroGenericStoreClient<K,V>
- Returns:
- Throws:
VeniceClientException
-
batchGet
protected java.util.concurrent.CompletableFuture<java.util.Map<K,V>> batchGet(BatchGetRequestContext<K,V> requestContext, java.util.Set<K> keys) throws VeniceClientException
- Throws:
VeniceClientException
-
streamingBatchGet
public final void streamingBatchGet(java.util.Set<K> keys, StreamingCallback<K,V> callback) throws VeniceClientException
Description copied from interface:AvroGenericStoreClient
Streaming interface forAvroGenericStoreClient.batchGet(Set)
. You can find more info inStreamingCallback
.- Specified by:
streamingBatchGet
in interfaceAvroGenericStoreClient<K,V>
- Throws:
VeniceClientException
-
streamingBatchGet
public final java.util.concurrent.CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(java.util.Set<K> keys) throws VeniceClientException
Description copied from interface:AvroGenericStoreClient
Get 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:
streamingBatchGet
in interfaceAvroGenericStoreClient<K,V>
- Returns:
- Throws:
VeniceClientException
-
streamingBatchGet
protected final java.util.concurrent.CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(BatchGetRequestContext<K,V> requestContext, java.util.Set<K> keys)
-
streamingBatchGet
protected abstract void streamingBatchGet(BatchGetRequestContext<K,V> requestContext, java.util.Set<K> keys, StreamingCallback<K,V> callback)
-
compute
public final void compute(ComputeRequestWrapper computeRequestWrapper, java.util.Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K,ComputeGenericRecord> callback, long preRequestTimeInNS) throws VeniceClientException
- Specified by:
compute
in interfaceAvroGenericReadComputeStoreClient<K,V>
- Throws:
VeniceClientException
-
compute
protected abstract void compute(ComputeRequestContext<K,V> requestContext, ComputeRequestWrapper computeRequestWrapper, java.util.Set<K> keys, org.apache.avro.Schema resultSchema, StreamingCallback<K,ComputeGenericRecord> callback, long preRequestTimeInNS) throws VeniceClientException
- 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:
computeWithKeyPrefixFilter
in interfaceAvroGenericReadComputeStoreClient<K,V>
-
-