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 voidonCancelled()Notify that the processing has been canceled.voidonCompleted()Notify that the processing has gracefully ended.booleanonError(java.lang.Throwable error)Called to notify there was anerrorin the commit reader.booleanonNext(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:LogObserverProcess next record in the commit log.- Specified by:
onNextin interfaceBatchLogObserver- 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
-
onCompleted
public void onCompleted()
Description copied from interface:LogObserverNotify that the processing has gracefully ended.- Specified by:
onCompletedin interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>
-
onCancelled
public void onCancelled()
Description copied from interface:LogObserverNotify that the processing has been canceled.- Specified by:
onCancelledin interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>
-
onError
public boolean onError(java.lang.Throwable error)
Description copied from interface:LogObserverCalled to notify there was anerrorin the commit reader.- Specified by:
onErrorin interfaceLogObserver<Offset,BatchLogObserver.OnNextContext>- Parameters:
error- error caught during processing- Returns:
trueto restart processing from last committed position,falseto stop processing
-
-