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:
java.lang.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 onBoundedReadFromUnboundedSource'sUnboundedToBoundedSourceAdapter, 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadvance()voidclose()CheckpointMarkTgetCheckpointMark()TgetCurrent()org.apache.beam.sdk.io.Source<T>getCurrentSource()org.joda.time.InstantgetCurrentTimestamp()org.joda.time.InstantgetWatermark()booleanstart()
-
-
-
Method Detail
-
start
public boolean start() throws java.io.IOException- Specified by:
startin classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
java.io.IOException
-
advance
public boolean advance() throws java.io.IOException- Specified by:
advancein classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
java.io.IOException
-
getCurrent
public T getCurrent() throws java.util.NoSuchElementException
- Specified by:
getCurrentin classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
java.util.NoSuchElementException
-
getCurrentTimestamp
public org.joda.time.Instant getCurrentTimestamp() throws java.util.NoSuchElementException- Specified by:
getCurrentTimestampin classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
java.util.NoSuchElementException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein classorg.apache.beam.sdk.io.Source.Reader<T>- Throws:
java.io.IOException
-
getCurrentSource
public org.apache.beam.sdk.io.Source<T> getCurrentSource()
- Specified by:
getCurrentSourcein classorg.apache.beam.sdk.io.Source.Reader<T>
-
getCheckpointMark
public CheckpointMarkT getCheckpointMark()
-
getWatermark
public org.joda.time.Instant getWatermark()
-
-