Package com.linkedin.venice.client.store
Interface AvroGenericStoreClient<K,V>
-
- Type Parameters:
V
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Subinterfaces:
AvroGenericReadComputeStoreClient<K,V>
,AvroSpecificStoreClient<K,V>
,DaVinciClient<K,V>
- All Known Implementing Classes:
AbstractAvroStoreClient
,AvroBlackHoleResponseStoreClientImpl
,AvroGenericDaVinciClient
,AvroGenericStoreClientImpl
,AvroSpecificDaVinciClient
,AvroSpecificStoreClientImpl
,DelegatingAvroGenericDaVinciClient
,DelegatingAvroStoreClient
,DelegatingStoreClient
,DispatchingAvroGenericStoreClient
,DispatchingAvroSpecificStoreClient
,DispatchingVsonStoreClient
,DualReadAvroGenericStoreClient
,DualReadAvroSpecificStoreClient
,InternalAvroStoreClient
,InternalAvroStoreClient
,RetriableAvroGenericStoreClient
,RetriableAvroSpecificStoreClient
,RetriableStoreClient
,SpecificRetriableStoreClient
,SpecificStatTrackingStoreClient
,StatsAvroGenericDaVinciClient
,StatsAvroGenericStoreClient
,StatsAvroSpecificDaVinciClient
,StatsAvroSpecificStoreClient
,StatTrackingStoreClient
,VsonGenericStoreClientImpl
public interface AvroGenericStoreClient<K,V> extends java.io.Closeable
Venice avro generic client to communicate with Venice backend for key-value lookup.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default 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
close()
Release the internal resources.ComputeRequestBuilder<K>
compute()
This API allows performing transformations (projection, vector arithmetic and aggregations like count) on the values associated with the given set of keys.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.default java.util.concurrent.CompletableFuture<V>
get(K key, V reusedValue)
Similar toget(Object)
except that it allows passing in a {@param reusedValue} instance, to minimize GC.org.apache.avro.Schema
getKeySchema()
Deprecated.This method is considered deprecated.org.apache.avro.Schema
getLatestValueSchema()
Deprecated.This method is considered deprecated.java.lang.String
getStoreName()
void
start()
default 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 forbatchGet(Set)
.
-
-
-
Method Detail
-
get
java.util.concurrent.CompletableFuture<V> get(K key) throws VeniceClientException
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.- Parameters:
key
-- Returns:
- Throws:
VeniceClientException
-
get
default java.util.concurrent.CompletableFuture<V> get(K key, V reusedValue) throws VeniceClientException
Similar toget(Object)
except that it allows passing in a {@param reusedValue} instance, to minimize GC.- Throws:
VeniceClientException
-
batchGet
default java.util.concurrent.CompletableFuture<java.util.Map<K,V>> batchGet(java.util.Set<K> keys) throws VeniceClientException
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.- Parameters:
keys
-- Returns:
- Throws:
VeniceClientException
-
streamingBatchGet
default java.util.concurrent.CompletableFuture<VeniceResponseMap<K,V>> streamingBatchGet(java.util.Set<K> keys) throws VeniceClientException
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.- Parameters:
keys
-- Returns:
- Throws:
VeniceClientException
-
streamingBatchGet
void streamingBatchGet(java.util.Set<K> keys, StreamingCallback<K,V> callback) throws VeniceClientException
Streaming interface forbatchGet(Set)
. You can find more info inStreamingCallback
.- Parameters:
keys
-callback
-- Throws:
VeniceClientException
-
compute
ComputeRequestBuilder<K> compute()
This API allows performing transformations (projection, vector arithmetic and aggregations like count) on the values associated with the given set of keys. Check outComputeRequestBuilder
for details on the available operations.- See Also:
ComputeRequestBuilder
-
start
void start() throws VeniceClientException
- Throws:
VeniceClientException
-
close
void close()
Release the internal resources.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
getStoreName
java.lang.String getStoreName()
-
getKeySchema
@Deprecated org.apache.avro.Schema getKeySchema()
Deprecated.This method is considered deprecated. Please useStoreSchemaFetcher.getKeySchema()
to fetch key schema instead.Get key schema.
-
getLatestValueSchema
@Deprecated org.apache.avro.Schema getLatestValueSchema()
Deprecated.This method is considered deprecated. Please useStoreSchemaFetcher.getLatestValueSchemaEntry()
to fetch latest value schema instead.Get the latest value schema known in current store client. This function doesn't guarantee it will return the latest schema if you add a new value schema when current store client is running.
-
-