Class ConfluentSchemaRegistryCoder

  • All Implemented Interfaces:
    org.apache.flink.formats.avro.SchemaCoder

    public class ConfluentSchemaRegistryCoder
    extends Object
    implements org.apache.flink.formats.avro.SchemaCoder
    Reads and Writes schema using Confluent Schema Registry protocol.
    • Constructor Detail

      • ConfluentSchemaRegistryCoder

        public ConfluentSchemaRegistryCoder​(String subject,
                                            io.confluent.kafka.schemaregistry.client.SchemaRegistryClient schemaRegistryClient)
        Creates SchemaCoder that uses provided SchemaRegistryClient to connect to schema registry.
        Parameters:
        schemaRegistryClient - client to connect schema registry
        subject - subject of schema registry to produce
      • ConfluentSchemaRegistryCoder

        public ConfluentSchemaRegistryCoder​(io.confluent.kafka.schemaregistry.client.SchemaRegistryClient schemaRegistryClient)
        Creates SchemaCoder that uses provided SchemaRegistryClient to connect to schema registry.
        Parameters:
        schemaRegistryClient - client to connect schema registry
    • Method Detail

      • readSchema

        public org.apache.avro.Schema readSchema​(InputStream in)
                                          throws IOException
        Specified by:
        readSchema in interface org.apache.flink.formats.avro.SchemaCoder
        Throws:
        IOException
      • writeSchema

        public void writeSchema​(org.apache.avro.Schema schema,
                                OutputStream out)
                         throws IOException
        Specified by:
        writeSchema in interface org.apache.flink.formats.avro.SchemaCoder
        Throws:
        IOException