Package org.apache.beam.sdk.io.xml
Class XmlSource<T>
java.lang.Object
org.apache.beam.sdk.io.Source<T>
org.apache.beam.sdk.io.BoundedSource<T>
org.apache.beam.sdk.io.OffsetBasedSource<T>
org.apache.beam.sdk.io.FileBasedSource<T>
org.apache.beam.sdk.io.xml.XmlSource<T>
- All Implemented Interfaces:
Serializable
,HasDisplayData
Implementation of
XmlIO.read()
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.FileBasedSource
FileBasedSource.FileBasedReader<T>, FileBasedSource.Mode
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.OffsetBasedSource
OffsetBasedSource.OffsetBasedReader<T>
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.BoundedSource
BoundedSource.BoundedReader<T>
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.Source
Source.Reader<T>
-
Method Summary
Modifier and TypeMethodDescriptionprotected FileBasedSource
<T> createForSubrangeOfFile
(MatchResult.Metadata metadata, long start, long end) Creates and returns a newFileBasedSource
of the same type as the currentFileBasedSource
backed by a given file and an offset range.protected FileBasedSource.FileBasedReader
<T> createSingleFileReader
(PipelineOptions options) Creates and returns an instance of aFileBasedReader
implementation for the current source assuming the source represents a single file.Returns theCoder
to use for the data read from this source.Methods inherited from class org.apache.beam.sdk.io.FileBasedSource
createReader, createSourceForSubrange, getEmptyMatchTreatment, getEstimatedSizeBytes, getFileOrPatternSpec, getFileOrPatternSpecProvider, getMaxEndOffset, getMode, getSingleFileMetadata, isSplittable, populateDisplayData, split, toString, validate
Methods inherited from class org.apache.beam.sdk.io.OffsetBasedSource
getBytesPerOffset, getEndOffset, getMinBundleSize, getStartOffset
Methods inherited from class org.apache.beam.sdk.io.Source
getDefaultOutputCoder
-
Method Details
-
createForSubrangeOfFile
protected FileBasedSource<T> createForSubrangeOfFile(MatchResult.Metadata metadata, long start, long end) Description copied from class:FileBasedSource
Creates and returns a newFileBasedSource
of the same type as the currentFileBasedSource
backed by a given file and an offset range. When current source is being split, this method is used to generate new sub-sources. When creating the source subclasses must call the constructorFileBasedSource(Metadata, long, long, long)
ofFileBasedSource
with corresponding parameter values passed here.- Specified by:
createForSubrangeOfFile
in classFileBasedSource<T>
- Parameters:
metadata
- file backing the newFileBasedSource
.start
- starting byte offset of the newFileBasedSource
.end
- ending byte offset of the newFileBasedSource
. May be Long.MAX_VALUE, in which case it will be inferred usingFileBasedSource.getMaxEndOffset(org.apache.beam.sdk.options.PipelineOptions)
.
-
createSingleFileReader
Description copied from class:FileBasedSource
Creates and returns an instance of aFileBasedReader
implementation for the current source assuming the source represents a single file. File patterns will be handled byFileBasedSource
implementation automatically.- Specified by:
createSingleFileReader
in classFileBasedSource<T>
-
getOutputCoder
Description copied from class:Source
Returns theCoder
to use for the data read from this source.- Overrides:
getOutputCoder
in classSource<T>
-