public static class UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter<T> extends UnboundedSource<T,UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>>
BoundedSource
to UnboundedSource
adapter.Modifier and Type | Class and Description |
---|---|
static class |
UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>
A marker representing the progress and state of an
UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter . |
UnboundedSource.CheckpointMark, UnboundedSource.UnboundedReader<OutputT>
Constructor and Description |
---|
BoundedToUnboundedSourceAdapter(BoundedSource<T> boundedSource) |
Modifier and Type | Method and Description |
---|---|
org.apache.beam.sdk.util.construction.UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Reader |
createReader(PipelineOptions options,
UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T> checkpoint)
Create a new
UnboundedSource.UnboundedReader to read from this source, resuming from the given
checkpoint if present. |
Coder<UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>> |
getCheckpointMarkCoder()
Returns a
Coder for encoding and decoding the checkpoints for this source. |
Coder<T> |
getDefaultOutputCoder() |
java.util.List<UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter<T>> |
split(int desiredNumSplits,
PipelineOptions options)
Returns a list of
UnboundedSource objects representing the instances of this source
that should be used when executing the workflow. |
void |
validate()
Checks that this source is valid, before it can be used in a pipeline.
|
requiresDeduping
getOutputCoder, populateDisplayData
public BoundedToUnboundedSourceAdapter(BoundedSource<T> boundedSource)
public void validate()
Source
It is recommended to use Preconditions
for implementing this method.
public java.util.List<UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter<T>> split(int desiredNumSplits, PipelineOptions options) throws java.lang.Exception
UnboundedSource
UnboundedSource
objects representing the instances of this source
that should be used when executing the workflow. Each split should return a separate partition
of the input data.
For example, for a source reading from a growing directory of files, each split could correspond to a prefix of file names.
Some sources are not splittable, such as reading from a single TCP stream. In that case, only a single split should be returned.
Some data sources automatically partition their data among readers. For these types of
inputs, n
identical replicas of the top-level source can be returned.
The size of the returned list should be as close to desiredNumSplits
as possible,
but does not have to match exactly. A low number of splits will limit the amount of parallelism
in the source.
split
in class UnboundedSource<T,UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>>
java.lang.Exception
public org.apache.beam.sdk.util.construction.UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Reader createReader(PipelineOptions options, UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T> checkpoint) throws java.io.IOException
UnboundedSource
UnboundedSource.UnboundedReader
to read from this source, resuming from the given
checkpoint if present.createReader
in class UnboundedSource<T,UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>>
java.io.IOException
public Coder<T> getDefaultOutputCoder()
getDefaultOutputCoder
in class Source<T>
public Coder<UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>> getCheckpointMarkCoder()
UnboundedSource
Coder
for encoding and decoding the checkpoints for this source.getCheckpointMarkCoder
in class UnboundedSource<T,UnboundedReadFromBoundedSource.BoundedToUnboundedSourceAdapter.Checkpoint<T>>