Class DeriveSchema
java.lang.Object
io.confluent.kafka.schemaregistry.maven.derive.schema.DeriveSchema
- Direct Known Subclasses:
DeriveAvroSchema,DeriveJsonSchema,DeriveProtobufSchema
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapperstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract com.fasterxml.jackson.databind.JsonNodeconvertToFormat(com.fasterxml.jackson.databind.JsonNode schema, String name) protected com.fasterxml.jackson.databind.JsonNodeOptional<com.fasterxml.jackson.databind.JsonNode>getPrimitiveSchema(com.fasterxml.jackson.databind.JsonNode field) com.fasterxml.jackson.databind.node.ObjectNodegetSchemaForArray(List<com.fasterxml.jackson.databind.JsonNode> messages, String name) Generate schema for array in json format, this schema is used as template by other formatscom.fasterxml.jackson.databind.node.ObjectNodegetSchemaForMultipleMessages(List<com.fasterxml.jackson.databind.JsonNode> messages) com.fasterxml.jackson.databind.node.ObjectNodegetSchemaForRecord(com.fasterxml.jackson.databind.node.ObjectNode message) Generate schema for record in json format, this schema is used as template by other formatsprotected List<com.fasterxml.jackson.databind.JsonNode>getSchemaOfAllElements(List<com.fasterxml.jackson.databind.JsonNode> messages, String name) protected voidgetSingleDataType(com.fasterxml.jackson.databind.node.ObjectNode mergedArray, com.fasterxml.jackson.databind.node.ArrayNode items) com.fasterxml.jackson.databind.node.ObjectNodemergeArrays(List<com.fasterxml.jackson.databind.JsonNode> arrayList, boolean useItems, boolean check2dArray) Merging different field types of array into one typeprotected abstract 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 abstract 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) com.fasterxml.jackson.databind.node.ObjectNodemergeRecords(List<com.fasterxml.jackson.databind.JsonNode> recordList) Merge fields in all the records together into one recordprotected voidupdateSchemaInformation(com.fasterxml.jackson.databind.JsonNode mergedSchema, com.fasterxml.jackson.databind.node.ArrayNode messagesMatched, com.fasterxml.jackson.databind.node.ArrayNode schemaInformationList)
-
Field Details
-
classToDataType
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper -
PRIMITIVE_SCHEMA_TYPE
- See Also:
-
-
Constructor Details
-
DeriveSchema
public DeriveSchema()
-
-
Method Details
-
getSchemaOfAllElements
protected List<com.fasterxml.jackson.databind.JsonNode> getSchemaOfAllElements(List<com.fasterxml.jackson.databind.JsonNode> messages, String name) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
checkName
-
getPrimitiveSchema
public Optional<com.fasterxml.jackson.databind.JsonNode> getPrimitiveSchema(com.fasterxml.jackson.databind.JsonNode field) -
getSchemaForArray
public com.fasterxml.jackson.databind.node.ObjectNode getSchemaForArray(List<com.fasterxml.jackson.databind.JsonNode> messages, String name) throws com.fasterxml.jackson.core.JsonProcessingException Generate schema for array in json format, this schema is used as template by other formats- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getSchemaForRecord
public com.fasterxml.jackson.databind.node.ObjectNode getSchemaForRecord(com.fasterxml.jackson.databind.node.ObjectNode message) throws com.fasterxml.jackson.core.JsonProcessingException Generate schema for record in json format, this schema is used as template by other formats- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
mergeRecords
public com.fasterxml.jackson.databind.node.ObjectNode mergeRecords(List<com.fasterxml.jackson.databind.JsonNode> recordList) Merge fields in all the records together into one record -
mergeArrays
public com.fasterxml.jackson.databind.node.ObjectNode mergeArrays(List<com.fasterxml.jackson.databind.JsonNode> arrayList, boolean useItems, boolean check2dArray) Merging different field types of array into one type -
getNullSchema
protected com.fasterxml.jackson.databind.JsonNode getNullSchema() -
getSchemaForMultipleMessages
public com.fasterxml.jackson.databind.node.ObjectNode getSchemaForMultipleMessages(List<com.fasterxml.jackson.databind.JsonNode> messages) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
updateSchemaInformation
protected void updateSchemaInformation(com.fasterxml.jackson.databind.JsonNode mergedSchema, com.fasterxml.jackson.databind.node.ArrayNode messagesMatched, com.fasterxml.jackson.databind.node.ArrayNode schemaInformationList) -
getSingleDataType
protected void getSingleDataType(com.fasterxml.jackson.databind.node.ObjectNode mergedArray, com.fasterxml.jackson.databind.node.ArrayNode items) -
convertToFormat
protected abstract com.fasterxml.jackson.databind.JsonNode convertToFormat(com.fasterxml.jackson.databind.JsonNode schema, String name) -
mergeMultipleDataTypes
protected abstract 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) -
mergeMultipleMessages
-