Class ConfluentRegistryAvroSerializationSchema<T>

  • Type Parameters:
    T - the type to be serialized
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.serialization.SerializationSchema<T>

    public class ConfluentRegistryAvroSerializationSchema<T>
    extends org.apache.flink.formats.avro.RegistryAvroSerializationSchema<T>
    Serialization schema that serializes to Avro binary format that uses Confluent Schema Registry.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.SerializationSchema

        org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext
    • Field Summary

      • Fields inherited from class org.apache.flink.formats.avro.RegistryAvroSerializationSchema

        schemaCoder
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ConfluentRegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric​(String subject, org.apache.avro.Schema schema, String schemaRegistryUrl)
      Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
      static ConfluentRegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric​(String subject, org.apache.avro.Schema schema, String schemaRegistryUrl, Map<String,​?> registryConfigs)
      Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
      static <T extends org.apache.avro.specific.SpecificRecord>
      ConfluentRegistryAvroSerializationSchema<T>
      forSpecific​(Class<T> tClass, String subject, String schemaRegistryUrl)
      Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
      static <T extends org.apache.avro.specific.SpecificRecord>
      ConfluentRegistryAvroSerializationSchema<T>
      forSpecific​(Class<T> tClass, String subject, String schemaRegistryUrl, Map<String,​?> registryConfigs)
      Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
      • Methods inherited from class org.apache.flink.formats.avro.RegistryAvroSerializationSchema

        checkAvroInitialized, equals, forGeneric, forGeneric, forSpecific, forSpecific, hashCode, serialize
      • Methods inherited from class org.apache.flink.formats.avro.AvroSerializationSchema

        forGeneric, forGeneric, forSpecific, forSpecific, getDatumWriter, getEncoder, getOutputStream, getSchema, open
    • Method Detail

      • forSpecific

        public static <T extends org.apache.avro.specific.SpecificRecord> ConfluentRegistryAvroSerializationSchema<T> forSpecific​(Class<T> tClass,
                                                                                                                                  String subject,
                                                                                                                                  String schemaRegistryUrl)
        Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
        Parameters:
        tClass - the type to be serialized
        subject - subject of schema registry to produce
        schemaRegistryUrl - URL of schema registry to connect
        Returns:
        serialized record
      • forSpecific

        public static <T extends org.apache.avro.specific.SpecificRecord> ConfluentRegistryAvroSerializationSchema<T> forSpecific​(Class<T> tClass,
                                                                                                                                  String subject,
                                                                                                                                  String schemaRegistryUrl,
                                                                                                                                  @Nullable
                                                                                                                                  Map<String,​?> registryConfigs)
        Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
        Parameters:
        tClass - the type to be serialized
        subject - subject of schema registry to produce
        schemaRegistryUrl - URL of schema registry to connect
        registryConfigs - map with additional schema registry configs (for example SSL properties)
        Returns:
        serialized record
      • forGeneric

        public static ConfluentRegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric​(String subject,
                                                                                                                 org.apache.avro.Schema schema,
                                                                                                                 String schemaRegistryUrl)
        Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
        Parameters:
        subject - subject of schema registry to produce
        schema - schema that will be used for serialization
        schemaRegistryUrl - URL of schema registry to connect
        Returns:
        serialized record
      • forGeneric

        public static ConfluentRegistryAvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric​(String subject,
                                                                                                                 org.apache.avro.Schema schema,
                                                                                                                 String schemaRegistryUrl,
                                                                                                                 @Nullable
                                                                                                                 Map<String,​?> registryConfigs)
        Creates AvroSerializationSchema that produces byte arrays that were generated from Avro schema and writes the writer schema to Confluent Schema Registry.
        Parameters:
        subject - subject of schema registry to produce
        schema - schema that will be used for serialization
        schemaRegistryUrl - URL of schema registry to connect
        registryConfigs - map with additional schema registry configs (for example SSL properties)
        Returns:
        serialized record