Package cz.o2.proxima.flink.core.batch
Class OffsetTrackingBatchLogReader.OffsetTrackingBatchLogObserver
- java.lang.Object
-
- cz.o2.proxima.flink.core.batch.OffsetTrackingBatchLogReader.OffsetTrackingBatchLogObserver
-
- All Implemented Interfaces:
BatchLogObserver
,LogObserver<Offset,BatchLogObserver.OnNextContext>
- Enclosing class:
- OffsetTrackingBatchLogReader
public static class OffsetTrackingBatchLogReader.OffsetTrackingBatchLogObserver extends java.lang.Object implements BatchLogObserver
Log observer, that keeps track of the "highest" consumed offset for each partition.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.batch.BatchLogObserver
BatchLogObserver.OnNextContext
-
-
Constructor Summary
Constructors Constructor Description OffsetTrackingBatchLogObserver(BatchLogObserver delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onCancelled()
Notify that the processing has been canceled.void
onCompleted()
Notify that the processing has gracefully ended.boolean
onError(java.lang.Throwable error)
Called to notify there was anerror
in the commit reader.boolean
onNext(StreamElement element, BatchLogObserver.OnNextContext context)
Process next record in the commit log.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.direct.core.batch.BatchLogObserver
onInterrupted, onNext
-
Methods inherited from interface cz.o2.proxima.direct.core.LogObserver
onException, onFatalError
-
-
-
-
Constructor Detail
-
OffsetTrackingBatchLogObserver
public OffsetTrackingBatchLogObserver(BatchLogObserver delegate)
-
-
Method Detail
-
onNext
public boolean onNext(StreamElement element, BatchLogObserver.OnNextContext context)
Description copied from interface:LogObserver
Process next record in the commit log.- Specified by:
onNext
in interfaceBatchLogObserver
- 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
-
onCompleted
public void onCompleted()
Description copied from interface:LogObserver
Notify that the processing has gracefully ended.- Specified by:
onCompleted
in interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>
-
onCancelled
public void onCancelled()
Description copied from interface:LogObserver
Notify that the processing has been canceled.- Specified by:
onCancelled
in interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>
-
onError
public boolean onError(java.lang.Throwable error)
Description copied from interface:LogObserver
Called to notify there was anerror
in the commit reader.- Specified by:
onError
in interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>
- Parameters:
error
- error caught during processing- Returns:
true
to restart processing from last committed position,false
to stop processing
-
-