Class WriteToText<InputT>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<InputT>,org.apache.beam.sdk.values.PDone>
-
- org.apache.beam.examples.complete.game.utils.WriteToText<InputT>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
public class WriteToText<InputT> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<InputT>,org.apache.beam.sdk.values.PDone>Generate, format, and write rows. Use provided information about the field names and types, as well as lambda functions that describe how to generate their values.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classWriteToText.BuildRowFnConvert each key/score pair into a row as specified by fieldFn.static interfaceWriteToText.FieldFn<InputT>ASerializablefunction from aDoFn.ProcessContextandBoundedWindowto the value for that field.protected static classWriteToText.PerWindowFilesAFileBasedSink.FilenamePolicyproduces a base file name for a write based on metadata about the data being written.protected static classWriteToText.WriteOneFilePerWindowADoFnthat writes elements to files with names deterministically derived from the lower and upper bounds of their key (anIntervalWindow).
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,WriteToText.FieldFn<InputT>>fieldFnprotected java.lang.StringfilenamePrefixprotected booleanwindowed
-
Constructor Summary
Constructors Constructor Description WriteToText()WriteToText(java.lang.String filenamePrefix, java.util.Map<java.lang.String,WriteToText.FieldFn<InputT>> fieldFn, boolean windowed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.values.PDoneexpand(org.apache.beam.sdk.values.PCollection<InputT> teamAndScore)-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Field Detail
-
filenamePrefix
protected java.lang.String filenamePrefix
-
fieldFn
protected java.util.Map<java.lang.String,WriteToText.FieldFn<InputT>> fieldFn
-
windowed
protected boolean windowed
-
-
Constructor Detail
-
WriteToText
public WriteToText()
-
WriteToText
public WriteToText(java.lang.String filenamePrefix, java.util.Map<java.lang.String,WriteToText.FieldFn<InputT>> fieldFn, boolean windowed)
-
-