Package org.apache.beam.runners.spark.io
Class MicrobatchSource<T,CheckpointMarkT extends UnboundedSource.CheckpointMark>
java.lang.Object
org.apache.beam.sdk.io.Source<T>
org.apache.beam.runners.spark.io.MicrobatchSource<T,CheckpointMarkT>
- All Implemented Interfaces:
Serializable
,HasDisplayData
public class MicrobatchSource<T,CheckpointMarkT extends UnboundedSource.CheckpointMark>
extends Source<T>
A
Source
that accommodates Spark's micro-batch oriented nature and wraps an UnboundedSource
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Mostly based onBoundedReadFromUnboundedSource
'sUnboundedToBoundedSourceAdapter
, with some adjustments for Spark specifics. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
boolean
getId()
getOrCreateReader
(PipelineOptions options, CheckpointMarkT checkpointMark) Returns theCoder
to use for the data read from this source.int
hashCode()
void
validate()
Checks that this source is valid, before it can be used in a pipeline.Methods inherited from class org.apache.beam.sdk.io.Source
getDefaultOutputCoder, populateDisplayData
-
Method Details
-
getOrCreateReader
public Source.Reader<T> getOrCreateReader(PipelineOptions options, CheckpointMarkT checkpointMark) throws IOException - Throws:
IOException
-
validate
public void validate()Description copied from class:Source
Checks that this source is valid, before it can be used in a pipeline.It is recommended to use
Preconditions
for implementing this method. -
getOutputCoder
Description copied from class:Source
Returns theCoder
to use for the data read from this source.- Overrides:
getOutputCoder
in classSource<T>
-
getCheckpointMarkCoder
-
getId
-
equals
-
hashCode
public int hashCode() -
clearCache
public static void clearCache()
-