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 interface
LogObserver.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 void
onCancelled()
Notify that the processing has been canceled.default void
onCompleted()
Notify that the processing has gracefully ended.default boolean
onError(java.lang.Throwable error)
Called to notify there was anerror
in the commit reader.default boolean
onException(java.lang.Exception exception)
Called to notify there was anexception
in the commit reader.default boolean
onFatalError(java.lang.Error error)
Called to notify there was anerror
in the commit reader.boolean
onNext(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 anerror
in the commit reader.- Parameters:
error
- error caught during processing- Returns:
true
to restart processing from last committed position,false
to stop processing
-
onException
default boolean onException(java.lang.Exception exception)
Called to notify there was anexception
in the commit reader. There is no guarantee this method gets called, ifonError(Throwable)
is overridden.- Parameters:
exception
- exception caught during processing- Returns:
true
to restart processing from last committed position,false
to stop processing
-
onFatalError
default boolean onFatalError(java.lang.Error error)
Called to notify there was anerror
in the commit reader. There is no guarantee this method gets called, ifonError(Throwable)
is overridden.- Parameters:
error
- error caught during processing- Returns:
true
to restart processing from last committed position,false
to 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:
true
if the processing should continue,false
otherwise
-
-