Class DeriveAvroSchema
java.lang.Object
io.confluent.kafka.schemaregistry.maven.derive.schema.DeriveSchema
io.confluent.kafka.schemaregistry.maven.derive.schema.DeriveAvroSchema
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class io.confluent.kafka.schemaregistry.maven.derive.schema.DeriveSchema
classToDataType, mapper, PRIMITIVE_SCHEMA_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.databind.JsonNodeconvertToFormat(com.fasterxml.jackson.databind.JsonNode schema, String name) Convert json schema template to avro format and validate generated schemaprotected com.fasterxml.jackson.databind.node.ObjectNodeconvertToFormatArray(com.fasterxml.jackson.databind.JsonNode schema, String name) protected com.fasterxml.jackson.databind.node.ObjectNodeconvertToFormatForRecord(com.fasterxml.jackson.databind.JsonNode schema, String name) protected com.fasterxml.jackson.databind.node.ObjectNodemergeMultipleDataTypes(com.fasterxml.jackson.databind.node.ObjectNode mergedArray, List<com.fasterxml.jackson.databind.JsonNode> primitives, List<com.fasterxml.jackson.databind.JsonNode> records, List<com.fasterxml.jackson.databind.JsonNode> arrays, boolean check2dArray) protected com.fasterxml.jackson.databind.node.ArrayNodemergeMultipleMessages(List<com.fasterxml.jackson.databind.JsonNode> uniqueSchemas, Map<com.fasterxml.jackson.databind.JsonNode, com.fasterxml.jackson.databind.node.ArrayNode> schemaToIndex) Using mergeRecords to combine number and union types of fieldsprotected voidmergeUnions(List<com.fasterxml.jackson.databind.JsonNode> records, List<com.fasterxml.jackson.databind.JsonNode> primitives) Check for fields with type union and null value, and if possible merge them Check recursively for records if there are multiple typesMethods inherited from class io.confluent.kafka.schemaregistry.maven.derive.schema.DeriveSchema
checkName, getNullSchema, getPrimitiveSchema, getSchemaForArray, getSchemaForMultipleMessages, getSchemaForRecord, getSchemaOfAllElements, getSingleDataType, mergeArrays, mergeRecords, updateSchemaInformation
-
Field Details
-
DOUBLE
- See Also:
-
STRING
- See Also:
-
BOOLEAN
- See Also:
-
INT
- See Also:
-
LONG
- See Also:
-
NULL
- See Also:
-
-
Constructor Details
-
DeriveAvroSchema
public DeriveAvroSchema()
-
-
Method Details
-
mergeMultipleMessages
protected com.fasterxml.jackson.databind.node.ArrayNode mergeMultipleMessages(List<com.fasterxml.jackson.databind.JsonNode> uniqueSchemas, Map<com.fasterxml.jackson.databind.JsonNode, com.fasterxml.jackson.databind.node.ArrayNode> schemaToIndex) Using mergeRecords to combine number and union types of fields- Specified by:
mergeMultipleMessagesin classDeriveSchema
-
mergeMultipleDataTypes
protected com.fasterxml.jackson.databind.node.ObjectNode mergeMultipleDataTypes(com.fasterxml.jackson.databind.node.ObjectNode mergedArray, List<com.fasterxml.jackson.databind.JsonNode> primitives, List<com.fasterxml.jackson.databind.JsonNode> records, List<com.fasterxml.jackson.databind.JsonNode> arrays, boolean check2dArray) - Specified by:
mergeMultipleDataTypesin classDeriveSchema
-
convertToFormat
protected com.fasterxml.jackson.databind.JsonNode convertToFormat(com.fasterxml.jackson.databind.JsonNode schema, String name) Convert json schema template to avro format and validate generated schema- Specified by:
convertToFormatin classDeriveSchema
-
convertToFormatForRecord
protected com.fasterxml.jackson.databind.node.ObjectNode convertToFormatForRecord(com.fasterxml.jackson.databind.JsonNode schema, String name) -
convertToFormatArray
protected com.fasterxml.jackson.databind.node.ObjectNode convertToFormatArray(com.fasterxml.jackson.databind.JsonNode schema, String name) -
mergeUnions
protected void mergeUnions(List<com.fasterxml.jackson.databind.JsonNode> records, List<com.fasterxml.jackson.databind.JsonNode> primitives) Check for fields with type union and null value, and if possible merge them Check recursively for records if there are multiple types
-