package coders
- Alphabetic
- Public
- Protected
Type Members
- trait AnnotatedKryoRegistrar extends AnyRef
Trait to be added to Kryo registrar class annotated with
@KryoRegistrar
. - final case class Beam[T] extends Coder[T] with Product with Serializable
- sealed trait Coder[T] extends Serializable
- Annotations
- @implicitNotFound("""
Cannot find an implicit Coder instance for type:
>> ${T}
This can happen for a few reasons, but the most common case is that a data
member somewhere within this type doesn't have an implicit Coder instance in scope.
Here are some debugging hints:
- For Option types, ensure that a Coder instance is in scope for the non-Option version.
- For List and Seq types, ensure that a Coder instance is in scope for a single element.
- For generic methods, you may need to add an implicit parameter so that
def foo[T](coll: SCollection[SomeClass], param: String): SCollection[T]
may become:
def foo[T](coll: SCollection[SomeClass],
param: String)(implicit c: Coder[T]): SCollection[T]
^
Alternatively, you can use a context bound instead of an implicit parameter:
def foo[T: Coder](coll: SCollection[SomeClass], param: String): SCollection[T]
^
read more here: https://spotify.github.io/scio/migrations/v0.7.0-Migration-Guide#add-missing-context-bounds
- You can check that an instance exists for Coder in the REPL or in your code:
scala> com.spotify.scio.coders.Coder[Foo]
And find the missing instance and construct it as needed.
""")
- sealed trait CoderGrammar extends AnyRef
Coder Grammar is used to explicitly specify Coder derivation for types used in pipelines.
Coder Grammar is used to explicitly specify Coder derivation for types used in pipelines.
The CoderGrammar can be used as follows: - To find the Coder being implicitly derived by Scio. (Debugging)
def c: Coder[MyType] = Coder[MyType]
- To generate an implicit instance to be in scope for type T, use Coder.gen
implicit def coderT: Coder[T] = Coder.gen[T]
Note: Implicit Coders for all parameters of the constructor of type T should be in scope for Coder.gen to be able to derive the Coder.
- To define a Coder of custom type, where the type can be mapped to some other type for which a Coder is known, use Coder.xmap
- To explicitly use kryo Coder use Coder.kryo
- final case class Disjunction[T, Id] extends Coder[T] with Product with Serializable
- final case class Fallback[T] extends Coder[T] with Product with Serializable
- final case class KVCoder[K, V] extends Coder[KV[K, V]] with Product with Serializable
- macro class KryoRegistrar extends Annotation with StaticAnnotation
Annotation for custom Kryo registrar classes.
Annotation for custom Kryo registrar classes.
Annotated class must extend
IKryoRegistrar
and has name that ends with "KryoRegistrar".- Annotations
- @compileTimeOnly("enable macro paradise (2.12) or -Ymacro-annotations (2.13) to expand macro annotations")
- trait LowPriorityCoderDerivation extends AnyRef
- trait LowPriorityCoders extends LowPriorityCoderDerivation
- final case class RawBeam[T] extends Coder[T] with Product with Serializable
- final case class Record[T] extends Coder[T] with Product with Serializable
- final case class Transform[A, B] extends Coder[B] with Product with Serializable
Value Members
- object Coder extends CoderGrammar with TupleCoders with AvroCoders with ProtobufCoders with AlgebirdCoders with GuavaCoders with JodaCoders with BeamTypeCoders with LowPriorityCoders with Serializable
- object CoderMaterializer
- object ScioKryoRegistrar extends Serializable