Package

org.oedura

scavro

Permalink

package scavro

Visibility
  1. Public
  2. All

Type Members

  1. trait AvroMetadata[S, J] extends AnyRef

    Permalink

    Provides a mapping between the Scala wrapper class S, which should extend AvroSerializeable, and the corresponding Java class J, which should extend org.apache.avro.specific.SpecificRecordBase.

    Provides a mapping between the Scala wrapper class S, which should extend AvroSerializeable, and the corresponding Java class J, which should extend org.apache.avro.specific.SpecificRecordBase. Typically an an implicit instance of this trait would be defined on the companion object of a class extending AvroSerializeable, and J would be a Java class produced by Avro code generation.

    An implicit instance with this trait will provide to Avro values that would in a Java application be provided by static members of the SpecificRecordBase.

    S

    Scala class

    J

    Java class from Avro code generation

  2. abstract class AvroReader[S <: AvroSerializeable] extends AnyRef

    Permalink

    Reads a serialized Avro file into the provided class.

    Reads a serialized Avro file into the provided class.

    val reader: AvroReader[MyAvroClass] = AvroReader[MyAvroClass]
    val dataRead: Seq[MyAvroClass] = reader.read("MyDataFile.avro")
    S

    Class to be deserialized

  3. trait AvroSerializeable extends AnyRef

    Permalink

    AvroSerializeable is the base trait of scala classes to be serialized or deserialized through the AvroReader and AvroWriter classes.

  4. class AvroWriter[S <: AvroSerializeable] extends AnyRef

    Permalink

    AvroWriter serializes a class that implements the AvroSerializeable trait and writes to the supplied OutputStream.

    AvroWriter serializes a class that implements the AvroSerializeable trait and writes to the supplied OutputStream.

    dataToWrite: Seq[MyOutputClass] = ...
    val writer = AvroWriter[MyOutputClass]("MyOutputFile.avro")
    writer.write(dataToWrite)
    S

    Type to be serialized

Value Members

  1. object AvroReader

    Permalink
  2. object AvroWriter

    Permalink

    Factory for AvroWriter instances.

Ungrouped