@Stable public interface LogObserver extends java.io.Serializable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
LogObserver.OffsetCommitter
Committer for manipulation with offset during consumption.
|
static interface |
LogObserver.OnIdleContext
Context passed to
onIdle(cz.o2.proxima.direct.commitlog.LogObserver.OnIdleContext). |
static interface |
LogObserver.OnNextContext
|
static interface |
LogObserver.OnRepartitionContext
|
| Modifier and Type | Method and 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 an {@link Throwable error) in the commit reader.
|
default boolean |
onException(java.lang.Exception exception)
Called to notify there was an
exception in the commit reader. |
default boolean |
onFatalError(java.lang.Error error)
Called to notify there was an
error in the commit reader. |
default void |
onIdle(LogObserver.OnIdleContext context)
Called when the observer is idle.
|
boolean |
onNext(StreamElement ingest,
LogObserver.OnNextContext context)
Process next record in the commit log.
|
default void |
onRepartition(LogObserver.OnRepartitionContext context)
Callback to notify of automatic repartitioning.
|
default void onCompleted()
default void onCancelled()
default boolean onError(java.lang.Throwable error)
error - error caught during processingtrue to restart processing from last committed position, false to stop
processingdefault boolean onException(java.lang.Exception exception)
exception in the commit reader. There is no
guarantee this method gets called, if onError(Throwable) is overridden.exception - exception caught during processingtrue to restart processing from last committed position, false to stop
processingdefault boolean onFatalError(java.lang.Error error)
error in the commit reader. There is no guarantee
this method gets called, if onError(Throwable) is overridden.error - error caught during processingtrue to restart processing from last committed position, false to stop
processingboolean onNext(StreamElement ingest, LogObserver.OnNextContext context)
ingest - the ingested data written to the commit logcontext - a context that the application must use to confirm processing of the ingest. If
the application fails to do so, the result is undefined.true if the processing should continue, false otherwisedefault void onRepartition(LogObserver.OnRepartitionContext context)
onNext(cz.o2.proxima.storage.StreamElement, cz.o2.proxima.direct.commitlog.LogObserver.OnNextContext) call happens.context - context of the repartitiondefault void onIdle(LogObserver.OnIdleContext context)
onNext(cz.o2.proxima.storage.StreamElement, cz.o2.proxima.direct.commitlog.LogObserver.OnNextContext) will be called eventually.
Typical example of commit log with no need to call onIdle(cz.o2.proxima.direct.commitlog.LogObserver.OnIdleContext) is google PubSub, having
virtually single shared partition which loads balances incoming data.
context - the context for on idle processingCopyright © 2017–2021. All rights reserved.