Interface LogObserver<OffsetT extends java.io.Serializable,​ContextT extends LogObserver.OnNextContext<OffsetT>>

    • 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 an error 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 an exception in the commit reader. There is no guarantee this method gets called, if onError(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 an error in the commit reader. There is no guarantee this method gets called, if onError(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 log
        context - 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