Class WriteComputeSchemaConverter
java.lang.Object
com.linkedin.venice.schema.writecompute.WriteComputeSchemaConverter
This class converts a Avro
Schema.Type.RECORD
schema to its write compute schema. Note that the input schema must
be of type Schema.Type.RECORD
.
Currently, it supports record partial update, collection merging and deletion
See WriteComputeOperation
for details.
N.B.
1. We should keep WriteComputeOperation
backward compatible. That's being said, if you change it, make
sure to release SN earlier than Samza/VPJ plugin.
2. We should ask partners to assign a default value or wrap the field with nullable union if they intent to use
"partial put" to create new k/v pair (when the key is not existing in the store).
3. nested parsing is not allowed in order to reduce the complexity. Only the top level fields will be converted.
Nested Record/Array/Map will remain the same after parsing.-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.avro.Schema
Deprecated.org.apache.avro.Schema
convert
(org.apache.avro.Schema schema) Deprecated.org.apache.avro.Schema
convertFromValueRecordSchema
(org.apache.avro.Schema valueRecordSchema) This method is the only entry point! Convert schema of a store value to its write-compute schema.org.apache.avro.Schema
convertFromValueRecordSchemaStr
(String valueRecordSchemaStr) static WriteComputeSchemaConverter
org.apache.avro.Schema
getNoOpOperation
(String namespace)
-
Method Details
-
getInstance
-
convertFromValueRecordSchemaStr
-
convertFromValueRecordSchema
public org.apache.avro.Schema convertFromValueRecordSchema(org.apache.avro.Schema valueRecordSchema) This method is the only entry point! Convert schema of a store value to its write-compute schema. Note that the value record schema must be of a Record type because write compute only works with Avro Record and each field needs to have a default value.- Parameters:
valueRecordSchema
- schema of store value.- Returns:
- Generated write-compute schema.
-
convert
Deprecated. -
convert
Deprecated. -
getNoOpOperation
-