Package org.apache.beam.sdk.io.xml
Class XmlIO.Read<T>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>
-
- org.apache.beam.sdk.io.xml.XmlIO.Read<T>
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- XmlIO
public abstract static class XmlIO.Read<T> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>Implementation ofXmlIO.read().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXmlIO.Read.CompressionTypeDeprecated.UseCompressioninstead.
-
Constructor Summary
Constructors Constructor Description Read()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.beam.sdk.values.PCollection<T>expand(org.apache.beam.sdk.values.PBegin input)XmlIO.Read<T>from(java.lang.String fileOrPatternSpec)Reads a single XML file or a set of XML files defined by a Java "glob" file pattern.XmlIO.Read<T>from(org.apache.beam.sdk.options.ValueProvider<java.lang.String> fileOrPatternSpec)Reads a single XML file or a set of XML files defined by a Java "glob" file pattern.voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)XmlIO.Read<T>withCharset(java.nio.charset.Charset charset)Sets the XML file charset.XmlIO.Read<T>withCompression(org.apache.beam.sdk.io.Compression compression)Decompresses all input files using the specified compression type.XmlIO.Read<T>withCompressionType(XmlIO.Read.CompressionType compressionType)Deprecated.XmlIO.Read<T>withMinBundleSize(long minBundleSize)Sets a parameterminBundleSizefor the minimum bundle size of the source.XmlIO.Read<T>withRecordClass(java.lang.Class<T> recordClass)Sets a JAXB annotated class that can be populated using a record of the provided XML file.XmlIO.Read<T>withRecordElement(java.lang.String recordElement)Sets name of the record element of the XML document.XmlIO.Read<T>withRootElement(java.lang.String rootElement)Sets name of the root element of the XML document.XmlIO.Read<T>withValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)Sets theValidationEventHandlerto use with JAXB.-
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
-
from
public XmlIO.Read<T> from(java.lang.String fileOrPatternSpec)
Reads a single XML file or a set of XML files defined by a Java "glob" file pattern. Each XML file should be of the form defined inXmlIO.read().
-
from
public XmlIO.Read<T> from(org.apache.beam.sdk.options.ValueProvider<java.lang.String> fileOrPatternSpec)
Reads a single XML file or a set of XML files defined by a Java "glob" file pattern. Each XML file should be of the form defined inXmlIO.read(). Using ValueProviders.
-
withRootElement
public XmlIO.Read<T> withRootElement(java.lang.String rootElement)
Sets name of the root element of the XML document. This will be used to create a valid starting root element when initiating a bundle of records created from an XML document. This is a required parameter.
-
withRecordElement
public XmlIO.Read<T> withRecordElement(java.lang.String recordElement)
Sets name of the record element of the XML document. This will be used to determine offset of the first record of a bundle created from the XML document. This is a required parameter.
-
withRecordClass
public XmlIO.Read<T> withRecordClass(java.lang.Class<T> recordClass)
Sets a JAXB annotated class that can be populated using a record of the provided XML file. This will be used when unmarshalling record objects from the XML file. This is a required parameter.
-
withMinBundleSize
public XmlIO.Read<T> withMinBundleSize(long minBundleSize)
Sets a parameterminBundleSizefor the minimum bundle size of the source. Please refer toOffsetBasedSourcefor the definition of minBundleSize. This is an optional parameter.
-
withCompressionType
@Deprecated public XmlIO.Read<T> withCompressionType(XmlIO.Read.CompressionType compressionType)
Deprecated.
-
withCompression
public XmlIO.Read<T> withCompression(org.apache.beam.sdk.io.Compression compression)
Decompresses all input files using the specified compression type.
-
withCharset
public XmlIO.Read<T> withCharset(java.nio.charset.Charset charset)
Sets the XML file charset.
-
withValidationEventHandler
public XmlIO.Read<T> withValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
Sets theValidationEventHandlerto use with JAXB. Calling this with anullparameter will cause the JAXB unmarshaller event handler to be unspecified.
-
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.PBegin,org.apache.beam.sdk.values.PCollection<T>>
-
-