public class AsJsons<InputT>
extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<InputT>,org.apache.beam.sdk.values.PCollection<java.lang.String>>
PTransform for serializing objects to JSON Strings. Transforms a PCollection<InputT> into a PCollection of JSON Strings representing
objects in the original PCollection using Jackson.| Modifier and Type | Method and Description |
|---|---|
org.apache.beam.sdk.values.PCollection<java.lang.String> |
expand(org.apache.beam.sdk.values.PCollection<InputT> input) |
static <OutputT> AsJsons<OutputT> |
of(java.lang.Class<? extends OutputT> outputClass)
Creates a
AsJsons PTransform that will transform a PCollection<InputT>
into a PCollection of JSON Strings representing those objects using a
Jackson ObjectMapper. |
AsJsons<InputT> |
withMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Use custom Jackson
ObjectMapper instead of the default one. |
public static <OutputT> AsJsons<OutputT> of(java.lang.Class<? extends OutputT> outputClass)
AsJsons PTransform that will transform a PCollection<InputT>
into a PCollection of JSON Strings representing those objects using a
Jackson ObjectMapper.public AsJsons<InputT> withMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
ObjectMapper instead of the default one.public org.apache.beam.sdk.values.PCollection<java.lang.String> expand(org.apache.beam.sdk.values.PCollection<InputT> input)
expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<InputT>,org.apache.beam.sdk.values.PCollection<java.lang.String>>