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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]