Package org.apache.beam.sdk.io.xml
Class XmlIO.Write<T>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>
-
- org.apache.beam.sdk.io.xml.XmlIO.Write<T>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- XmlIO
public abstract static class XmlIO.Write<T> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>Implementation ofXmlIO.write().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Write()
-
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<T> input)voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)XmlIO.Write<T>to(java.lang.String filenamePrefix)Writes to files with the given path prefix.XmlIO.Write<T>withCharset(java.nio.charset.Charset charset)Sets the charset used to write the file.XmlIO.Write<T>withRecordClass(java.lang.Class<T> recordClass)Writes objects of the given class mapped to XML elements using JAXB.XmlIO.Write<T>withRootElement(java.lang.String rootElement)Sets the enclosing root element for the generated XML files.-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
to
public XmlIO.Write<T> to(java.lang.String filenamePrefix)
Writes to files with the given path prefix.Output files will have the name {filenamePrefix}-0000i-of-0000n.xml where n is the number of output bundles.
-
withRecordClass
public XmlIO.Write<T> withRecordClass(java.lang.Class<T> recordClass)
Writes objects of the given class mapped to XML elements using JAXB.The specified class must be able to be used to create a JAXB context.
-
withRootElement
public XmlIO.Write<T> withRootElement(java.lang.String rootElement)
Sets the enclosing root element for the generated XML files.
-
withCharset
public XmlIO.Write<T> withCharset(java.nio.charset.Charset charset)
Sets the charset used to write the file.
-
expand
public org.apache.beam.sdk.values.PDone expand(org.apache.beam.sdk.values.PCollection<T> input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,org.apache.beam.sdk.values.PDone>
-
-