Interface AvroGenericStoreClient<K,​V>

    • 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 to get(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 for batchGet(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 throw ExecutionException, which is a wrapper of the real exception.
        Parameters:
        key -
        Returns:
        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 a TimeoutException. It means this function could return either full response or partial response.
        Parameters:
        keys -
        Returns:
        Throws:
        VeniceClientException
      • close

        void close()
        Release the internal resources.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • getStoreName

        java.lang.String getStoreName()
      • getKeySchema

        @Deprecated
        org.apache.avro.Schema getKeySchema()
        Deprecated.
        This method is considered deprecated. Please use StoreSchemaFetcher.getKeySchema() to fetch key schema instead.
        Get key schema.
      • getLatestValueSchema

        @Deprecated
        org.apache.avro.Schema getLatestValueSchema()
        Deprecated.
        This method is considered deprecated. Please use StoreSchemaFetcher.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.