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.OnNextContextdefaultContext(Partition partition)CreateBatchLogObserver.OnNextContextwhich holds watermark back onWatermarks.MIN_WATERMARKuntil the end of data.static BatchLogObserver.OnNextContextwithWatermark(Partition partition, Offset offset, long watermark)CreateBatchLogObserver.OnNextContextwhich sets watermark ti given epoch millis.static BatchLogObserver.OnNextContextwithWatermarkSupplier(Partition partition, Offset offset, WatermarkSupplier watermark)CreateBatchLogObserver.OnNextContextwhich moves watermark according to givenWatermarkSupplier.
-
-
-
Method Detail
-
defaultContext
public static BatchLogObserver.OnNextContext defaultContext(Partition partition)
CreateBatchLogObserver.OnNextContextwhich holds watermark back onWatermarks.MIN_WATERMARKuntil 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.OnNextContextfor given partition
-
withWatermarkSupplier
public static BatchLogObserver.OnNextContext withWatermarkSupplier(Partition partition, Offset offset, WatermarkSupplier watermark)
CreateBatchLogObserver.OnNextContextwhich moves watermark according to givenWatermarkSupplier.- Parameters:
partition- the partition to create context foroffset- offset of a current elementwatermark-WatermarkSupplierfor 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.OnNextContextfor given partition and given watermark supplier
-
withWatermark
public static BatchLogObserver.OnNextContext withWatermark(Partition partition, Offset offset, long watermark)
CreateBatchLogObserver.OnNextContextwhich 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.OnNextContextfor given partition with given watermark
-
-