You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/10/06 16:01:05 UTC

[GitHub] [nifi] michael81877 commented on a diff in pull request #6369: NIFI-10273: added support for files larger than 8.5GB to MergeContent…

michael81877 commented on code in PR #6369:
URL: https://github.com/apache/nifi/pull/6369#discussion_r989230023


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java:
##########
@@ -827,6 +833,17 @@ public void process(final OutputStream rawOut) throws IOException {
             return bundle;
         }
 
+        private long getMaxEntrySize(List<FlowFile> contents) {
+            Optional<FlowFile> ffOpt = contents.stream()
+                .parallel()
+                .max(Comparator.comparingLong(ff -> ff.getSize()));
+            if (ffOpt.isPresent()) {
+                return ffOpt.get().getSize();
+            } else {
+                return 0L;
+            }

Review Comment:
   Ah that's a good shout. Changing that!
   
   Will `mapToLong()`, `max()`, and return `longVal.orElse(0)`



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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org