Package cz.o2.proxima.beam.direct.io
Class DirectBatchUnboundedSource.StreamElementUnboundedReader
- java.lang.Object
-
- org.apache.beam.sdk.io.Source.Reader<OutputT>
-
- org.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>
-
- cz.o2.proxima.beam.direct.io.DirectBatchUnboundedSource.StreamElementUnboundedReader
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Enclosing class:
- DirectBatchUnboundedSource
private static class DirectBatchUnboundedSource.StreamElementUnboundedReader extends org.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AttributeDescriptor<?>>attributesprivate longconsumedFromCurrentprivate StreamElementcurrentprivate longinitialCheckpointSkipprivate BlockingQueueLogObserver.BatchLogObserverobserverprivate BatchLogReaderreaderprivate ObserveHandlerunningHandleprivate PartitionrunningPartitionprivate longskipprivate DirectBatchUnboundedSourcesourceprivate java.util.List<Partition>toProcessprivate longwatermark
-
Constructor Summary
Constructors Constructor Description StreamElementUnboundedReader(DirectBatchUnboundedSource source, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attributes, DirectBatchUnboundedSource.Checkpoint checkpointMark, java.util.List<Partition> toProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadvance()voidclose()org.apache.beam.sdk.io.UnboundedSource.CheckpointMarkgetCheckpointMark()StreamElementgetCurrent()org.apache.beam.sdk.io.UnboundedSource<StreamElement,?>getCurrentSource()org.joda.time.InstantgetCurrentTimestamp()org.joda.time.InstantgetWatermark()private BlockingQueueLogObserver.BatchLogObservernewObserver(Partition partition)booleanstart()private booleanstartNewObserver()
-
-
-
Field Detail
-
source
private final DirectBatchUnboundedSource source
-
reader
private final BatchLogReader reader
-
attributes
private final java.util.List<AttributeDescriptor<?>> attributes
-
toProcess
private final java.util.List<Partition> toProcess
-
observer
@Nullable private BlockingQueueLogObserver.BatchLogObserver observer
-
initialCheckpointSkip
private final long initialCheckpointSkip
-
consumedFromCurrent
private long consumedFromCurrent
-
current
@Nullable private StreamElement current
-
skip
private long skip
-
runningPartition
@Nullable private Partition runningPartition
-
runningHandle
@Nullable private ObserveHandle runningHandle
-
watermark
private long watermark
-
-
Constructor Detail
-
StreamElementUnboundedReader
public StreamElementUnboundedReader(DirectBatchUnboundedSource source, BatchLogReader reader, java.util.List<AttributeDescriptor<?>> attributes, @Nullable DirectBatchUnboundedSource.Checkpoint checkpointMark, java.util.List<Partition> toProcess)
-
-
Method Detail
-
start
public boolean start() throws java.io.IOException- Specified by:
startin classorg.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>- Throws:
java.io.IOException
-
advance
public boolean advance() throws java.io.IOException- Specified by:
advancein classorg.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>- Throws:
java.io.IOException
-
startNewObserver
private boolean startNewObserver()
-
newObserver
private BlockingQueueLogObserver.BatchLogObserver newObserver(Partition partition)
-
getWatermark
public org.joda.time.Instant getWatermark()
- Specified by:
getWatermarkin classorg.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>
-
getCheckpointMark
public org.apache.beam.sdk.io.UnboundedSource.CheckpointMark getCheckpointMark()
- Specified by:
getCheckpointMarkin classorg.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>
-
getCurrentSource
public org.apache.beam.sdk.io.UnboundedSource<StreamElement,?> getCurrentSource()
- Specified by:
getCurrentSourcein classorg.apache.beam.sdk.io.UnboundedSource.UnboundedReader<StreamElement>
-
getCurrent
public StreamElement getCurrent() throws java.util.NoSuchElementException
- Specified by:
getCurrentin classorg.apache.beam.sdk.io.Source.Reader<StreamElement>- 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<StreamElement>- Throws:
java.util.NoSuchElementException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein classorg.apache.beam.sdk.io.Source.Reader<StreamElement>
-
-