JonathanKessler commented on a change in pull request #4780:
URL: https://github.com/apache/nifi/pull/4780#discussion_r582151894



##########
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:
       Understood and agreed. I will update accordingly.




----------------------------------------------------------------
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]


Reply via email to