JonathanKessler commented on a change in pull request #4780:
URL: https://github.com/apache/nifi/pull/4780#discussion_r583147093
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/SwappablePriorityQueue.java
##########
@@ -920,7 +921,14 @@ public SwapSummary recoverSwappedFlowFiles() {
return new StandardSwapSummary(new QueueSize(swapFlowFileCount,
swapByteCount), maxId, resourceClaims);
}
+ public long getMaxActiveQueuedDuration(long fromTimestamp) {
+ // We want the oldest timestamp, which will be the min
+ return fromTimestamp -
activeQueue.parallelStream().map(FlowFile::getLastQueueDate).filter(Objects::nonNull).min(Long::compareTo).orElse(fromTimestamp);
Review comment:
Disregard my previous question, I misunderstood how swap files worked. I
now understand that all flowfiles are swapped in from a given swap file at the
same time vs one at a time. Therefore we only need to know what the min last
queued date is, as well as the total of all last queued dates and total number
of swapped flow files. From that we can extrapolate anything else we may need.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]