Package org.apache.beam.sdk.io
Class ReadAllViaFileBasedSourceWithFilename<T>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<FileIO.ReadableFile>,PCollection<KV<String,T>>>
org.apache.beam.sdk.io.ReadAllViaFileBasedSourceTransform<T,KV<String,T>>
org.apache.beam.sdk.io.ReadAllViaFileBasedSourceWithFilename<T>
- All Implemented Interfaces:
Serializable
,HasDisplayData
public class ReadAllViaFileBasedSourceWithFilename<T>
extends ReadAllViaFileBasedSourceTransform<T,KV<String,T>>
Reads each file of the input
PCollection
and outputs each element as the value of a
KV
, where the key is the filename from which that value came.
Reads each FileIO.ReadableFile
using given parameters for splitting files into offset
ranges and for creating a FileBasedSource
for a file. The input PCollection
must
not contain directories
.
To obtain the collection of FileIO.ReadableFile
from a filepattern, use FileIO.readMatches()
.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.ReadAllViaFileBasedSourceTransform
ReadAllViaFileBasedSourceTransform.AbstractReadFileRangesFn<InT,
T>, ReadAllViaFileBasedSourceTransform.SplitIntoRangesFn -
Field Summary
Fields inherited from class org.apache.beam.sdk.io.ReadAllViaFileBasedSourceTransform
coder, createSource, DEFAULT_USES_RESHUFFLE, desiredBundleSizeBytes, exceptionHandler, usesReshuffle
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
ConstructorsConstructorDescriptionReadAllViaFileBasedSourceWithFilename
(long desiredBundleSizeBytes, SerializableFunction<String, ? extends FileBasedSource<T>> createSource, Coder<KV<String, T>> coder) -
Method Summary
Modifier and TypeMethodDescriptionprotected DoFn
<KV<FileIO.ReadableFile, OffsetRange>, KV<String, T>> Methods inherited from class org.apache.beam.sdk.io.ReadAllViaFileBasedSourceTransform
expand
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
-
Constructor Details
-
ReadAllViaFileBasedSourceWithFilename
public ReadAllViaFileBasedSourceWithFilename(long desiredBundleSizeBytes, SerializableFunction<String, ? extends FileBasedSource<T>> createSource, Coder<KV<String, T>> coder)
-
-
Method Details
-
readRangesFn
- Specified by:
readRangesFn
in classReadAllViaFileBasedSourceTransform<T,
KV<String, T>>
-