Class WriteComputeSchemaConverter
- java.lang.Object
-
- com.linkedin.venice.schema.writecompute.WriteComputeSchemaConverter
-
public class WriteComputeSchemaConverter extends java.lang.Object
This class converts a AvroSchema.Type.RECORD
schema to its write compute schema. Note that the input schema must be of typeSchema.Type.RECORD
. Currently, it supports record partial update, collection merging and deletion SeeWriteComputeOperation
for details. N.B. 1. We should keepWriteComputeOperation
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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.avro.Schema
convert(java.lang.String schemaStr)
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(java.lang.String valueRecordSchemaStr)
static WriteComputeSchemaConverter
getInstance()
org.apache.avro.Schema
getNoOpOperation(java.lang.String namespace)
-
-
-
Method Detail
-
getInstance
public static WriteComputeSchemaConverter getInstance()
-
convertFromValueRecordSchemaStr
public org.apache.avro.Schema convertFromValueRecordSchemaStr(java.lang.String valueRecordSchemaStr)
-
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 public org.apache.avro.Schema convert(java.lang.String schemaStr)
Deprecated.
-
convert
@Deprecated public org.apache.avro.Schema convert(org.apache.avro.Schema schema)
Deprecated.
-
getNoOpOperation
public org.apache.avro.Schema getNoOpOperation(java.lang.String namespace)
-
-