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 15:57:30 UTC
[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6369: NIFI-10273: added support for files larger than 8.5GB to MergeContent…
exceptionfactory commented on code in PR #6369:
URL: https://github.com/apache/nifi/pull/6369#discussion_r989224932
##########
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:
It looks like this could be streamlined a bit more to map `FlowFile` to size, and chained together with `orElse(0)` to keep the entire process in one functional chain of methods.
--
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