[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

2018-09-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/2954


---


[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

2018-09-24 Thread markap14
Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2954#discussion_r219837666
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeRecord.java
 ---
@@ -304,13 +336,25 @@ public void onTrigger(final ProcessContext context, 
final ProcessSessionFactory
 session.commit();
 }
 
+// If there is no more data queued up, complete any bin that meets 
our minimum threshold
+int completedBins = 0;
+final QueueSize queueSize = session.getQueueSize();
--- End diff --

@bdesert that's a great catch! I have pushed a new commit that updates the 
code like you suggested, to just check the size of the flowFiles list. I also 
created NIFI-5626 to address the inconsistency between MockProcessSession and 
StandardProcessSession.


---


[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

2018-09-22 Thread bdesert
Github user bdesert commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2954#discussion_r219683471
  
--- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeRecord.java
 ---
@@ -304,13 +336,25 @@ public void onTrigger(final ProcessContext context, 
final ProcessSessionFactory
 session.commit();
 }
 
+// If there is no more data queued up, complete any bin that meets 
our minimum threshold
+int completedBins = 0;
+final QueueSize queueSize = session.getQueueSize();
--- End diff --

@markap14 
Test for MinRecords is successful, but actual flow doesn't work as expected 
and still doesn't respect Min Records setting.
There is my set up:

![image](https://user-images.githubusercontent.com/19496093/45922181-efa6f880-be92-11e8-92b1-4f6daf756463.png)


![image](https://user-images.githubusercontent.com/19496093/45922183-02b9c880-be93-11e8-9565-fe8ef8908245.png)

The problem is in different behavior of MockProcessSession and 
StandardProcessSession.
MockProcessSession.getQueueSize() will return 0, after session.get(...)
StandardProcessSession.getQueueSize() will return same number as before 
session.get(...), regardless flow files have been polled or not.
As a result, this condition will block from actually emitting FF when min 
requirements are reached.

I would recommend to change this condition to:
if (flowFiles.size() != 0) {...}

In parallel, we probably need to open a JIRA for inconsistency between 
MockProcessSession and StandardProcessSession.



---


[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

2018-08-16 Thread markap14
GitHub user markap14 opened a pull request:

https://github.com/apache/nifi/pull/2954

NIFI-5514: Fixed bugs in MergeRecord around minimum thresholds not be…

…ing honored and validation not being performed to ensure that minimum 
threshold is smaller than max threshold (would previously allow min record = 
100, max records = 2 as a valid configuration)

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/markap14/nifi NIFI-5514

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/2954.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2954


commit 8f13109e9064c6721f3bcb3dc472ec94e481835b
Author: Mark Payne 
Date:   2018-08-16T18:08:43Z

NIFI-5514: Fixed bugs in MergeRecord around minimum thresholds not being 
honored and validation not being performed to ensure that minimum threshold is 
smaller than max threshold (would previously allow min record = 100, max 
records = 2 as a valid configuration)




---