private static class BatchLogReaders.ThroughputLimitedBatchLogObserver extends BatchLogReaders.ForwardingBatchLogObserver
BatchLogObserver.OnNextContext| Modifier and Type | Field and Description |
|---|---|
private java.util.Collection<Partition> |
assignedPartitions |
private ThroughputLimiter |
limiter |
private long |
watermark |
| Constructor and Description |
|---|
ThroughputLimitedBatchLogObserver(BatchLogObserver delegate,
java.util.Collection<Partition> assignedPartitions,
ThroughputLimiter limiter) |
| Modifier and Type | Method and Description |
|---|---|
private ThroughputLimiter.Context |
getLimiterContext() |
void |
onCancelled()
Signalled when the reading is cancelled.
|
void |
onCompleted()
Signalled when the reading is finished.
|
boolean |
onError(java.lang.Throwable error)
Signaled when reading error occurs.
|
boolean |
onNext(StreamElement element)
Read next data from the batch storage.
|
boolean |
onNext(StreamElement element,
BatchLogObserver.OnNextContext context)
Read next data from the batch storage.
|
private void |
waitIfNecessary() |
private final java.util.Collection<Partition> assignedPartitions
private final ThroughputLimiter limiter
private long watermark
public ThroughputLimitedBatchLogObserver(BatchLogObserver delegate, java.util.Collection<Partition> assignedPartitions, ThroughputLimiter limiter)
public void onCompleted()
BatchLogObserverpublic boolean onError(java.lang.Throwable error)
BatchLogObservererror - error caught during processingtrue to restart processing from beginning false to stop processingpublic void onCancelled()
BatchLogObserverpublic boolean onNext(StreamElement element)
BatchLogObserverelement - the retrieved data elementtrue to continue processing, false otherwisepublic boolean onNext(StreamElement element, BatchLogObserver.OnNextContext context)
BatchLogObserverelement - the retrieved data elementcontext - context of the data elementtrue to continue processing, false otherwiseprivate void waitIfNecessary()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprivate ThroughputLimiter.Context getLimiterContext()
Copyright © 2017–2021. All rights reserved.