Class WriteComputeProcessor
java.lang.Object
com.linkedin.davinci.schema.writecompute.WriteComputeProcessor
This class is able to read write-computed value and apply it to original value.
Notice: though it's possible, we only support GenericRecord updating at this point. That's
being said, both original and write compute object need to be GenericRecord.
Currently, Venice supports 3 kinds of updates.
1. Record partial update.
2. Collection merging.
3. Value deletion.
This class has the knowledge of different versions of write compute so that it can dispatch method calls to their
corresponding write compute logic.
Note that write-compute is only available for the root level field. Parsing nested fields are not supported at this point.
TODO: since this class is very performance sensitive, we should add metrics to measure the
TODO: time it spends and keep optimizing the operations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.avro.generic.GenericRecord
updateRecord
(org.apache.avro.Schema valueSchema, org.apache.avro.generic.GenericRecord currRecord, org.apache.avro.generic.GenericRecord writeComputeRecord) Apply write-compute operations on the given record.ValueAndRmd<org.apache.avro.generic.GenericRecord>
updateRecordWithRmd
(org.apache.avro.Schema currValueSchema, ValueAndRmd<org.apache.avro.generic.GenericRecord> oldRecordAndRmd, org.apache.avro.generic.GenericRecord writeComputeRecord, long updateOperationTimestamp, int updateOperationColoID)
-
Constructor Details
-
WriteComputeProcessor
-
-
Method Details
-
updateRecord
public org.apache.avro.generic.GenericRecord updateRecord(org.apache.avro.Schema valueSchema, org.apache.avro.generic.GenericRecord currRecord, org.apache.avro.generic.GenericRecord writeComputeRecord) Apply write-compute operations on the given record.- Parameters:
valueSchema
- the original value schema that write compute schema is derived from- Returns:
- write-compute updated record
-
updateRecordWithRmd
public ValueAndRmd<org.apache.avro.generic.GenericRecord> updateRecordWithRmd(org.apache.avro.Schema currValueSchema, ValueAndRmd<org.apache.avro.generic.GenericRecord> oldRecordAndRmd, org.apache.avro.generic.GenericRecord writeComputeRecord, long updateOperationTimestamp, int updateOperationColoID)
-