Package cz.o2.proxima.beam.direct.io
Class BeamBatchLogReader
- java.lang.Object
-
- org.apache.beam.sdk.io.Source.Reader<T>
-
- org.apache.beam.sdk.io.BoundedSource.BoundedReader<StreamElement>
-
- cz.o2.proxima.beam.direct.io.BeamBatchLogReader
-
- All Implemented Interfaces:
java.lang.AutoCloseable
class BeamBatchLogReader extends org.apache.beam.sdk.io.BoundedSource.BoundedReader<StreamElement>
ABoundedSource.BoundedReaderreading fromBatchLogReader.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AttributeDescriptor<?>>attrsprivate StreamElementcurrentprivate longendStampprivate booleanfinishedprivate static org.joda.time.InstantHIGHEST_INSTANTprivate static org.joda.time.InstantLOWEST_INSTANTprivate BlockingQueueLogObserver.BatchLogObserverobserverprivate BatchLogReaderreaderprivate DirectBatchSourcesourceprivate Partitionsplitprivate longstartStamp
-
Constructor Summary
Constructors Modifier Constructor Description privateBeamBatchLogReader(DirectBatchSource source, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attrs, Partition split, long startStamp, long endStamp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadvance()voidclose()StreamElementgetCurrent()org.apache.beam.sdk.io.BoundedSource<StreamElement>getCurrentSource()org.joda.time.InstantgetCurrentTimestamp()(package private) static BeamBatchLogReaderof(DirectBatchSource source, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attrs, Partition split, long startStamp, long endStamp)booleanstart()
-
-
-
Field Detail
-
LOWEST_INSTANT
private static final org.joda.time.Instant LOWEST_INSTANT
-
HIGHEST_INSTANT
private static final org.joda.time.Instant HIGHEST_INSTANT
-
source
private final DirectBatchSource source
-
reader
private final BatchLogReader reader
-
attrs
private final java.util.List<AttributeDescriptor<?>> attrs
-
split
private final Partition split
-
startStamp
private final long startStamp
-
endStamp
private final long endStamp
-
current
private StreamElement current
-
observer
private BlockingQueueLogObserver.BatchLogObserver observer
-
finished
private boolean finished
-
-
Constructor Detail
-
BeamBatchLogReader
private BeamBatchLogReader(DirectBatchSource source, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attrs, Partition split, long startStamp, long endStamp)
-
-
Method Detail
-
of
static BeamBatchLogReader of(DirectBatchSource source, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attrs, Partition split, long startStamp, long endStamp)
-
getCurrentSource
public org.apache.beam.sdk.io.BoundedSource<StreamElement> getCurrentSource()
- Specified by:
getCurrentSourcein classorg.apache.beam.sdk.io.BoundedSource.BoundedReader<StreamElement>
-
start
public boolean start() throws java.io.IOException- Specified by:
startin classorg.apache.beam.sdk.io.Source.Reader<StreamElement>- Throws:
java.io.IOException
-
advance
public boolean advance() throws java.io.IOException- Specified by:
advancein classorg.apache.beam.sdk.io.Source.Reader<StreamElement>- Throws:
java.io.IOException
-
getCurrent
public StreamElement getCurrent() throws java.util.NoSuchElementException
- Specified by:
getCurrentin classorg.apache.beam.sdk.io.Source.Reader<StreamElement>- 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<StreamElement>- Throws:
java.io.IOException
-
getCurrentTimestamp
public org.joda.time.Instant getCurrentTimestamp() throws java.util.NoSuchElementException- Overrides:
getCurrentTimestampin classorg.apache.beam.sdk.io.BoundedSource.BoundedReader<StreamElement>- Throws:
java.util.NoSuchElementException
-
-