Class CoderRegistry

java.lang.Object
org.apache.beam.sdk.coders.CoderRegistry

public class CoderRegistry extends Object
A CoderRegistry allows creating a Coder for a given Java class or type descriptor.

Creation of the Coder is delegated to one of the many registered coder providers based upon the registration order.

By default, the coder provider precedence order is as follows:

  • Coder providers registered programmatically with registerCoderProvider(CoderProvider).
  • A default coder provider for common Java (Byte, Double, List, ...) and Apache Beam (KV, ...) types.
  • Coder providers registered automatically through a CoderProviderRegistrar using a ServiceLoader. Note that the ServiceLoader registration order is consistent but may change due to the addition or removal of libraries exposed to the application. This can impact the coder returned if multiple coder providers are capable of supplying a coder for the specified type.

Note that if multiple coder providers can provide a Coder for a given type, the precedence order above defines which CoderProvider is chosen.