Class AvroSchemaParser<U>

java.lang.Object
io.apicurio.registry.serde.avro.AvroSchemaParser<U>
All Implemented Interfaces:
io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>

public class AvroSchemaParser<U> extends Object implements io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>
  • Constructor Summary

    Constructors
    Constructor
    Description
    AvroSchemaParser(AvroDatumProvider<U> avroDatumProvider, int schemaCacheSize)
    Creates a new AvroSchemaParser with the given datum provider and schema cache size.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema>
    getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data)
     
    io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema>
    getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data, boolean dereference)
     
    boolean
    isComplexType(org.apache.avro.Schema.Type type)
     
    org.apache.avro.Schema
    parseSchema(byte[] rawSchema, Map<String,io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema>> resolvedReferences)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.apicurio.registry.resolver.SchemaParser

    getSchemaFromLocation, supportsExtractSchemaFromData, supportsGetSchemaFromLocation
  • Constructor Details

    • AvroSchemaParser

      public AvroSchemaParser(AvroDatumProvider<U> avroDatumProvider, int schemaCacheSize)
      Creates a new AvroSchemaParser with the given datum provider and schema cache size.
      Parameters:
      avroDatumProvider - the datum provider for converting data payloads to Avro schemas
      schemaCacheSize - the maximum number of entries in each schema cache (LRU eviction)
  • Method Details

    • artifactType

      public String artifactType()
      Specified by:
      artifactType in interface io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>
      See Also:
      • SchemaParser.artifactType()
    • parseSchema

      public org.apache.avro.Schema parseSchema(byte[] rawSchema, Map<String,io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema>> resolvedReferences)
      Specified by:
      parseSchema in interface io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>
      See Also:
      • SchemaParser.parseSchema(byte[], Map)
    • getSchemaFromData

      public io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema> getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data)
      Specified by:
      getSchemaFromData in interface io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>
      See Also:
      • SchemaParser.getSchemaFromData(Record)
    • getSchemaFromData

      public io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema> getSchemaFromData(io.apicurio.registry.resolver.data.Record<U> data, boolean dereference)
      Specified by:
      getSchemaFromData in interface io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>
      See Also:
      • SchemaParser.getSchemaFromData(Record, boolean)
    • isComplexType

      public boolean isComplexType(org.apache.avro.Schema.Type type)