Package io.pravega.client.stream.impl
Class WatermarkReaderImpl
- java.lang.Object
-
- io.pravega.client.stream.impl.WatermarkReaderImpl
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class WatermarkReaderImpl extends java.lang.Object implements java.lang.AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description WatermarkReaderImpl(Stream stream, RevisionedStreamClient<io.pravega.shared.watermarks.Watermark> markClient, java.util.concurrent.Executor executor)
Creates a Reader to keep track of the current time window for a given stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advanceTo(java.util.Map<SegmentWithRange,java.lang.Long> readerGroupPosition)
Advances the position in the watermark segment based on the provided position.void
close()
TimeWindow
getTimeWindow()
Returns the current time window of the reader group for the associated stream.
-
-
-
Constructor Detail
-
WatermarkReaderImpl
public WatermarkReaderImpl(Stream stream, RevisionedStreamClient<io.pravega.shared.watermarks.Watermark> markClient, java.util.concurrent.Executor executor)
Creates a Reader to keep track of the current time window for a given stream.- Parameters:
stream
- The stream to read the water marks for.markClient
- The segment to read marks from.executor
- A threadpool to perform background operations.
-
-
Method Detail
-
advanceTo
public void advanceTo(java.util.Map<SegmentWithRange,java.lang.Long> readerGroupPosition)
Advances the position in the watermark segment based on the provided position.- Parameters:
readerGroupPosition
- - The latest read positions of the open segments in the reader group.
-
getTimeWindow
public TimeWindow getTimeWindow()
Returns the current time window of the reader group for the associated stream. The value returned will only change after callingadvanceTo(Map)
.- Returns:
- TimeWindow the bounds on the upper and lower times provided by the writer at the time of writing.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-