Package org.apache.beam.runners.spark.io
Class MicrobatchSource.Reader
java.lang.Object
org.apache.beam.sdk.io.Source.Reader<T>
org.apache.beam.runners.spark.io.MicrobatchSource.Reader
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
MicrobatchSource<T,CheckpointMarkT extends org.apache.beam.sdk.io.UnboundedSource.CheckpointMark>
public class MicrobatchSource.Reader
extends org.apache.beam.sdk.io.Source.Reader<T>
Mostly based on
BoundedReadFromUnboundedSource's
UnboundedToBoundedSourceAdapter, with some adjustments for Spark specifics.
This Reader reads until one of the following thresholds has been reached:
- max records (per batch)
- max read duration (per batch)
-
Method Details
-
start
- Specified by:
startin classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
IOException
-
advance
- Specified by:
advancein classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
IOException
-
getCurrent
- Specified by:
getCurrentin classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
NoSuchElementException
-
getCurrentTimestamp
- Specified by:
getCurrentTimestampin classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
NoSuchElementException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
IOException
-
getCurrentSource
- Specified by:
getCurrentSourcein classorg.apache.beam.sdk.io.Source.Reader<T>
-
getCheckpointMark
-
getWatermark
public org.joda.time.Instant getWatermark()
-