Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1394#discussion_r95726870
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java
---
@@ -326,6 +329,27 @@ public void process(InputStream in) throws IOException
{
return splitFlowFiles;
}
+ /**
+ * Will merge the two files. This operation has different semantics
then
+ * sessioin.merge. Also, it always expects 2 and no more then 2 flow
files,
+ * so vararg signature primarily for simplification.
+ */
+ private FlowFile merge(ProcessSession session, FlowFile... flowFiles) {
--- End diff --
Since this method does simply adding header to each split, naming this as
`prependHeader` would make its purpose clearer. The keyword `merge` is
counter-intuitive in the context of this SplitText processor. How do you think
a method signature like this?
```java
/**
* @param split a FlowFile for the split, this will be removed from session
* @return newly created flow file contains header and split merged
**/
private FlowFile prependHeader(ProcessSession session, FlowFile header,
FlowFile split)
```
With this, we don't have to mention that this is different from
session.merge, nor explain about the var args.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---