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 interface
BatchLogObserver.OnNextContext
Context passed toLogObserver.onNext(cz.o2.proxima.core.storage.StreamElement, ContextT)
.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
onInterrupted()
Called when the consumption is cancelled in caseonNext(StreamElement, OnNextContext)
method is blocked and should be interrupted.default boolean
onNext(StreamElement element)
Read next data from the batch storage.default boolean
onNext(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:
true
to continue processing,false
otherwise
-
onNext
default boolean onNext(StreamElement element, BatchLogObserver.OnNextContext context)
Description copied from interface:LogObserver
Process next record in the commit log.- Specified by:
onNext
in 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:
true
if the processing should continue,false
otherwise
-
onInterrupted
default void onInterrupted()
Called when the consumption is cancelled in caseonNext(StreamElement, OnNextContext)
method is blocked and should be interrupted.
-
-