public class InFlightMessageTracker extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InFlightMessageTracker.Counts |
| Modifier and Type | Field and Description |
|---|---|
private ConcurrentMap<FlowFile,Exception> |
failures |
private ComponentLog |
logger |
private ConcurrentMap<FlowFile,InFlightMessageTracker.Counts> |
messageCountsByFlowFile |
private Object |
progressMutex |
| Constructor and Description |
|---|
InFlightMessageTracker(ComponentLog logger) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
awaitCompletion(long millis) |
(package private) PublishResult |
createPublishResult() |
void |
fail(FlowFile flowFile,
Exception exception) |
PublishResult |
failOutstanding(Exception exception) |
int |
getAcknowledgedCount(FlowFile flowFile) |
Exception |
getFailure(FlowFile flowFile) |
int |
getSentCount(FlowFile flowFile) |
void |
incrementAcknowledgedCount(FlowFile flowFile) |
void |
incrementSentCount(FlowFile flowFile) |
private boolean |
isComplete() |
private boolean |
isComplete(FlowFile flowFile) |
boolean |
isFailed(FlowFile flowFile) |
void |
reset() |
void |
trackEmpty(FlowFile flowFile)
This method guarantees that the specified FlowFile to be transferred to
'success' relationship even if it did not derive any Kafka message.
|
private final ConcurrentMap<FlowFile,InFlightMessageTracker.Counts> messageCountsByFlowFile
private final ConcurrentMap<FlowFile,Exception> failures
private final Object progressMutex
private final ComponentLog logger
public InFlightMessageTracker(ComponentLog logger)
public void incrementAcknowledgedCount(FlowFile flowFile)
public void trackEmpty(FlowFile flowFile)
public int getAcknowledgedCount(FlowFile flowFile)
public void incrementSentCount(FlowFile flowFile)
public int getSentCount(FlowFile flowFile)
public boolean isFailed(FlowFile flowFile)
public void reset()
public PublishResult failOutstanding(Exception exception)
private boolean isComplete(FlowFile flowFile)
private boolean isComplete()
void awaitCompletion(long millis)
throws InterruptedException,
TimeoutException
InterruptedExceptionTimeoutExceptionPublishResult createPublishResult()
Copyright © 2022 Apache NiFi Project. All rights reserved.