Package cz.o2.proxima.direct.core.batch
Interface BatchLogObserver
-
- All Superinterfaces:
LogObserver<Offset,BatchLogObserver.OnNextContext>
- All Known Implementing Classes:
BatchLogReaders.ForwardingBatchLogObserver,OffsetTrackingBatchLogReader.OffsetTrackingBatchLogObserver
@Stable public interface BatchLogObserver extends LogObserver<Offset,BatchLogObserver.OnNextContext>
Batch observer of data. No commits needed.Implementations should override either of `onNext` methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceBatchLogObserver.OnNextContextContext passed toLogObserver.onNext(cz.o2.proxima.core.storage.StreamElement, ContextT).
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidonInterrupted()Called when the consumption is cancelled in caseonNext(StreamElement, OnNextContext)method is blocked and should be interrupted.default booleanonNext(StreamElement element)Read next data from the batch storage.default booleanonNext(StreamElement element, BatchLogObserver.OnNextContext context)Process next record in the commit log.-
Methods inherited from interface cz.o2.proxima.direct.core.LogObserver
onCancelled, onCompleted, onError, onException, onFatalError
-
-
-
-
Method Detail
-
onNext
default boolean onNext(StreamElement element)
Read next data from the batch storage.- Parameters:
element- the retrieved data element- Returns:
trueto continue processing,falseotherwise
-
onNext
default boolean onNext(StreamElement element, BatchLogObserver.OnNextContext context)
Description copied from interface:LogObserverProcess next record in the commit log.- Specified by:
onNextin interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>- Parameters:
element- the element written to the commit logcontext- a context that the application must use to confirm processing of the element. If the application fails to do so, the result is undefined.- Returns:
trueif the processing should continue,falseotherwise
-
onInterrupted
default void onInterrupted()
Called when the consumption is cancelled in caseonNext(StreamElement, OnNextContext)method is blocked and should be interrupted.
-
-