Package cz.o2.proxima.direct.core.batch
Class BatchLogObservers
- java.lang.Object
-
- cz.o2.proxima.direct.core.batch.BatchLogObservers
-
@Internal public class BatchLogObservers extends java.lang.Object
Utility class related toBatchLogObservers
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BatchLogObserver.OnNextContext
defaultContext(Partition partition)
CreateBatchLogObserver.OnNextContext
which holds watermark back onWatermarks.MIN_WATERMARK
until the end of data.static BatchLogObserver.OnNextContext
withWatermark(Partition partition, Offset offset, long watermark)
CreateBatchLogObserver.OnNextContext
which sets watermark ti given epoch millis.static BatchLogObserver.OnNextContext
withWatermarkSupplier(Partition partition, Offset offset, WatermarkSupplier watermark)
CreateBatchLogObserver.OnNextContext
which moves watermark according to givenWatermarkSupplier
.
-
-
-
Method Detail
-
defaultContext
public static BatchLogObserver.OnNextContext defaultContext(Partition partition)
CreateBatchLogObserver.OnNextContext
which holds watermark back onWatermarks.MIN_WATERMARK
until the end of data. This is the default behavior of batch readers when there is no way to time-order data.- Parameters:
partition
- the partition to create context for- Returns:
- a wrapped
BatchLogObserver.OnNextContext
for given partition
-
withWatermarkSupplier
public static BatchLogObserver.OnNextContext withWatermarkSupplier(Partition partition, Offset offset, WatermarkSupplier watermark)
CreateBatchLogObserver.OnNextContext
which moves watermark according to givenWatermarkSupplier
.- Parameters:
partition
- the partition to create context foroffset
- offset of a current elementwatermark
-WatermarkSupplier
for watermark at any given time. The supplier can assume that each element gets consumed immediately after being passed toBatchLogObserver.onNext(cz.o2.proxima.core.storage.StreamElement)
- Returns:
- a wrapped
BatchLogObserver.OnNextContext
for given partition and given watermark supplier
-
withWatermark
public static BatchLogObserver.OnNextContext withWatermark(Partition partition, Offset offset, long watermark)
CreateBatchLogObserver.OnNextContext
which sets watermark ti given epoch millis.- Parameters:
partition
- the partition to create context foroffset
- offset of a current elementwatermark
- epoch millis to set the watermark to- Returns:
- a wrapped
BatchLogObserver.OnNextContext
for given partition with given watermark
-
-