Class AvroComputeRequestBuilderV3<K>

java.lang.Object
com.linkedin.venice.client.store.AbstractAvroComputeRequestBuilder<K>
com.linkedin.venice.client.store.AvroComputeRequestBuilderV3<K>
Type Parameters:
K -
All Implemented Interfaces:
ComputeRequestBuilder<K>
Direct Known Subclasses:
AvroComputeRequestBuilderV4

public class AvroComputeRequestBuilderV3<K> extends AbstractAvroComputeRequestBuilder<K>
This class is used to build a ComputeRequestWrapper object according to the specification, and this class will invoke AbstractAvroStoreClient to send the 'compute' request to backend. This class is package-private on purpose.
  • Constructor Details

  • Method Details

    • getResultSchema

      protected SchemaAndToString getResultSchema()
      Overrides:
      getResultSchema in class AbstractAvroComputeRequestBuilder<K>
    • getComputeRequestOperations

      protected List<ComputeOperation> getComputeRequestOperations()
      Description copied from class: AbstractAvroComputeRequestBuilder
      Generate compute operations for projections, dot-product and cosine-similarity.
      Overrides:
      getComputeRequestOperations in class AbstractAvroComputeRequestBuilder<K>
      Returns:
      a list of existing compute operations
    • count

      public ComputeRequestBuilder<K> count(String inputFieldName, String resultFieldName)
      Description copied from interface: ComputeRequestBuilder
      Set up compute operation. It would return the number of records for array/map field.
      Parameters:
      inputFieldName - : top-level field in the value record as the input of count operation
      resultFieldName - : result field name in the response record
      Returns:
    • executeWithFilter

      public void executeWithFilter(Predicate predicate, StreamingCallback<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> callback)
      Description copied from interface: ComputeRequestBuilder
      Streaming interface that sends compute request to Venice, which will be executed on values whose keys satisfy the given predicate. This can be used to execute partial key lookups. If predicate is null, the compute request will be executed on all values. You can find more info in StreamingCallback. This experimental feature is subject to backwards-incompatible changes in the future.
      Parameters:
      predicate - : predicate which specifies some required leading top-level key fields
      callback - : streaming callback which stores the result from the compute request