@Internal public abstract class TransformTranslator<InT extends PInput,OutT extends POutput,TransformT extends PTransform<? extends InT,OutT>> extends java.lang.Object
TransformTranslator
provides the capability to translate a specific primitive or
composite PTransform
into its Spark correspondence.
WARNING: TransformTranslators
should never be serializable! This
could easily hide situations where unnecessary references leak into Spark closures.
Modifier and Type | Class and Description |
---|---|
protected class |
TransformTranslator.Context
Available mutable context to translate a
PTransform . |
Constructor and Description |
---|
TransformTranslator() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canTranslate(TransformT transform)
Checks if a composite / primitive transform can be translated.
|
protected abstract void |
translate(TransformT transform,
TransformTranslator.Context cxt) |
protected <T> Coder<BoundedWindow> |
windowCoder(PCollection<T> pc) |
protected abstract void translate(TransformT transform, TransformTranslator.Context cxt) throws java.io.IOException
java.io.IOException
protected boolean canTranslate(TransformT transform)
This should be overridden where necessary. If a transform is know to be unsupported, this should throw a runtime exception to give early feedback before any part of the pipeline is run.
protected <T> Coder<BoundedWindow> windowCoder(PCollection<T> pc)