diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java index 88da5fff55..fbf400b4c5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java @@ -2990,9 +2990,18 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C long droppedSize = 0; DropFlowFileState state = null; + boolean allFinished = true; + String failureReason = null; for (final Map.Entry nodeEntry : dropRequestMap.entrySet()) { final DropRequestDTO nodeDropRequest = nodeEntry.getValue(); + if (!nodeDropRequest.isFinished()) { + allFinished = false; + } + if (nodeDropRequest.getFailureReason() != null) { + failureReason = nodeDropRequest.getFailureReason(); + } + currentCount += nodeDropRequest.getCurrentCount(); currentSize += nodeDropRequest.getCurrentSize(); droppedCount += nodeDropRequest.getDroppedCount(); @@ -3006,7 +3015,7 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C } final DropFlowFileState nodeState = DropFlowFileState.valueOfDescription(nodeDropRequest.getState()); - if (state == null || state.compareTo(nodeState) > 0) { + if (state == null || state.ordinal() > nodeState.ordinal()) { state = nodeState; } } @@ -3019,6 +3028,14 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C dropRequest.setDroppedSize(droppedSize); dropRequest.setDropped(FormatUtils.formatCount(droppedCount) + " / " + FormatUtils.formatDataSize(droppedSize)); + dropRequest.setFinished(allFinished); + dropRequest.setFailureReason(failureReason); + if (originalCount == 0) { + dropRequest.setPercentCompleted(allFinished ? 100 : 0); + } else { + dropRequest.setPercentCompleted((int) ((double) droppedCount / (double) originalCount * 100D)); + } + if (!nodeWaiting) { dropRequest.setOriginalCount(originalCount); dropRequest.setOriginalSize(originalSize);