Package cz.o2.proxima.direct.core
Interface LogObserver<OffsetT extends java.io.Serializable,ContextT extends LogObserver.OnNextContext<OffsetT>>
-
- All Known Subinterfaces:
BatchLogObserver,CommitLogObserver
- All Known Implementing Classes:
BatchLogReaders.ForwardingBatchLogObserver,CommitLogObservers.ForwardingObserver,OffsetTrackingBatchLogReader.OffsetTrackingBatchLogObserver,ThreadPooledObserver,TransactionLogObserver,TransformationObserver,TransformationObserver.Contextual,TransformationObserver.NonContextual
@Stable public interface LogObserver<OffsetT extends java.io.Serializable,ContextT extends LogObserver.OnNextContext<OffsetT>>
Base interface for bulk and online observers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLogObserver.OnNextContext<OffsetT extends java.io.Serializable>Context passed toonNext(cz.o2.proxima.core.storage.StreamElement, ContextT).
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidonCancelled()Notify that the processing has been canceled.default voidonCompleted()Notify that the processing has gracefully ended.default booleanonError(java.lang.Throwable error)Called to notify there was anerrorin the commit reader.default booleanonException(java.lang.Exception exception)Called to notify there was anexceptionin the commit reader.default booleanonFatalError(java.lang.Error error)Called to notify there was anerrorin the commit reader.booleanonNext(StreamElement element, ContextT context)Process next record in the commit log.
-
-
-
Method Detail
-
onCompleted
default void onCompleted()
Notify that the processing has gracefully ended.
-
onCancelled
default void onCancelled()
Notify that the processing has been canceled.
-
onError
default boolean onError(java.lang.Throwable error)
Called to notify there was anerrorin the commit reader.- Parameters:
error- error caught during processing- Returns:
trueto restart processing from last committed position,falseto stop processing
-
onException
default boolean onException(java.lang.Exception exception)
Called to notify there was anexceptionin the commit reader. There is no guarantee this method gets called, ifonError(Throwable)is overridden.- Parameters:
exception- exception caught during processing- Returns:
trueto restart processing from last committed position,falseto stop processing
-
onFatalError
default boolean onFatalError(java.lang.Error error)
Called to notify there was anerrorin the commit reader. There is no guarantee this method gets called, ifonError(Throwable)is overridden.- Parameters:
error- error caught during processing- Returns:
trueto restart processing from last committed position,falseto stop processing
-
onNext
boolean onNext(StreamElement element, ContextT context)
Process next record in the commit log.- 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
-
-