Class

za.co.absa.abris.avro.read.confluent

ScalaConfluentKafkaAvroDeserializer

Related Doc: package confluent

Permalink

class ScalaConfluentKafkaAvroDeserializer extends AnyRef

This class provides methods to deserialize Confluent binary Avro records into Spark Rows with schemas.

Please, invest some time in understanding how it works and above all, read the documentation for the method 'deserialize()'.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScalaConfluentKafkaAvroDeserializer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScalaConfluentKafkaAvroDeserializer(topic: Option[String], readerSchema: Option[Schema])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def configureSchemaRegistry(configs: Map[String, String]): Unit

    Permalink

    This class does not hold a Schema Registry client instance.

    This class does not hold a Schema Registry client instance. Instead, it relies on SchemaManager. This, this method configures the Schema Registry on SchemaManager.

    This is here as a utility, so that users do not need to invoke SchemaManager in their codes at any time.

  7. def deserialize(payload: Array[Byte]): GenericRecord

    Permalink

    Converts the Avro binary payload into an Avro's GenericRecord.

    Converts the Avro binary payload into an Avro's GenericRecord. Important highlights:

    1. This uses the ScalaDatumReader to parse the bytes. 2. This takes into account Confluent's specific metadata included in the payload (e.g. schema id), thus, it will not work on regular binary Avro records. 3. If there is a topic defined in the constructor and access to Schema Registry is configured, the schema retrieved from the later will be considered the writer schema, otherwise, the reader schema passed to the constructor will be used as both, reader and writer (thus notice that either, topic or reader schema must be informed). 4. The Avro DatumReader is cached based on the schema id, thus, if a new id is received as part of the payload, a new DatumReader will be created for that id, with a new schema being retrieved, iff the topic is informed and Schema Registry is configured. 5. Although changes in the schema are supported, it is important to bear in mind that this class's main reason of existence is to parse GenericRecords that will be later converted into Spark Rows. This conversion relies on RowEncoders, which need to be instantiated once, outside this class. Thus, even though schema changes can be dealt with here, they cannot be translated into new RowEncoders, which could generate from exceptions to inconsistencies in the final data.

    The only way to overcome the issue described in 5. is to change Spark code itself, which would then be able to change the RowEncoder instance on the fly as a new schema version is detected.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. val readerSchema: Option[Schema]

    Permalink
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. val topic: Option[String]

    Permalink
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped