You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2015/12/18 17:56:26 UTC

[1/2] nifi git commit: nifi-1272 Fixing a bug in StandardProcessSession.get(int) which returns incorrect number of flowfiles

Repository: nifi
Updated Branches:
  refs/heads/master f239be289 -> 9ca0f95d0


nifi-1272 Fixing a bug in StandardProcessSession.get(int) which returns incorrect number of flowfiles

Signed-off-by: Mark Payne <ma...@hotmail.com>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/fa4c5314
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/fa4c5314
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/fa4c5314

Branch: refs/heads/master
Commit: fa4c5314caed6960f9d2a9e9c115e7594972cee3
Parents: f239be2
Author: ianwww <ia...@ironnetcybersecurity.com>
Authored: Tue Dec 8 15:19:52 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Dec 18 11:50:39 2015 -0500

----------------------------------------------------------------------
 .../apache/nifi/controller/repository/StandardProcessSession.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/fa4c5314/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
index 22fee7f..d2ba55d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
@@ -1210,7 +1210,7 @@ public final class StandardProcessSession implements ProcessSession, ProvenanceE
 
                     @Override
                     public FlowFileFilterResult filter(final FlowFile flowFile) {
-                        if (++polled <= maxResults) {
+                        if (++polled < maxResults) {
                             return FlowFileFilterResult.ACCEPT_AND_CONTINUE;
                         } else {
                             return FlowFileFilterResult.ACCEPT_AND_TERMINATE;


[2/2] nifi git commit: NIFI-1272: Added unit test to verify behavior

Posted by ma...@apache.org.
NIFI-1272: Added unit test to verify behavior


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/9ca0f95d
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/9ca0f95d
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/9ca0f95d

Branch: refs/heads/master
Commit: 9ca0f95d0685fc1a76a50eae978638916f1dbbcd
Parents: fa4c531
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Dec 18 11:51:42 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Dec 18 11:51:42 2015 -0500

----------------------------------------------------------------------
 .../repository/TestStandardProcessSession.java        | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/9ca0f95d/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
index d549a00..644018f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
@@ -1106,6 +1106,20 @@ public class TestStandardProcessSession {
     }
 
     @Test
+    public void testGetWithCount() {
+        for (int i = 0; i < 8; i++) {
+            final FlowFileRecord flowFile = new StandardFlowFileRecord.Builder()
+                .id(i)
+                .addAttribute("uuid", "000000000000-0000-0000-0000-0000000" + i)
+                .build();
+            this.flowFileQueue.put(flowFile);
+        }
+
+        final List<FlowFile> flowFiles = session.get(7);
+        assertEquals(7, flowFiles.size());
+    }
+
+    @Test
     public void testAttributesModifiedEmitted() throws IOException {
         final FlowFileRecord flowFile = new StandardFlowFileRecord.Builder()
             .id(1L)