nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tk...@apache.org
Subject [26/50] [abbrv] nifi git commit: NIFI-1105: Only trigger a processor that requires input to run if data is available for it process
Date Mon, 09 Nov 2015 04:27:00 GMT
NIFI-1105: Only trigger a processor that requires input to run if data is available for it
process


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

Branch: refs/heads/NIFI-1073
Commit: 2b1d093120fe3f70594909b97f2658828a09044e
Parents: dbf0c78
Author: Mark Payne <markap14@hotmail.com>
Authored: Wed Nov 4 08:41:10 2015 -0500
Committer: Mark Payne <markap14@hotmail.com>
Committed: Wed Nov 4 08:41:10 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/nifi/controller/queue/FlowFileQueue.java  | 7 +++----
 .../org/apache/nifi/controller/StandardFlowFileQueue.java     | 3 ++-
 .../src/main/java/org/apache/nifi/util/Connectables.java      | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/2b1d0931/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
----------------------------------------------------------------------
diff --git a/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java b/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
index dcf7f13..727c755 100644
--- a/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
+++ b/nifi-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
@@ -100,10 +100,9 @@ public interface FlowFileQueue {
     boolean isEmpty();
 
     /**
-     * @return true if the active queue is empty; false otherwise. The Active
-     *         queue contains those FlowFiles that can be processed immediately and does
-     *         not include those FlowFiles that have been swapped out or are currently
-     *         being processed
+     * @return <code>true</code> if the queue is empty or contains only FlowFiles
that already are being processed
+     *         by others, <code>false</code> if the queue contains at least one
FlowFile that is available for processing,
+     *         regardless of whether that FlowFile(s) is in-memory or swapped out.
      */
     boolean isActiveQueueEmpty();
 

http://git-wip-us.apache.org/repos/asf/nifi/blob/2b1d0931/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
index 6b6bb57..3986ca8 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowFileQueue.java
@@ -210,7 +210,8 @@ public final class StandardFlowFileQueue implements FlowFileQueue {
 
     @Override
     public boolean isActiveQueueEmpty() {
-        return size.get().activeQueueCount == 0;
+        final FlowFileQueueSize queueSize = size.get();
+        return queueSize.activeQueueCount == 0 && queueSize.swappedCount == 0;
     }
 
     public QueueSize getActiveQueueSize() {

http://git-wip-us.apache.org/repos/asf/nifi/blob/2b1d0931/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
index 3c4fcdb..c4d040b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/Connectables.java
@@ -26,7 +26,7 @@ public class Connectables {
 
     public static boolean flowFilesQueued(final Connectable connectable) {
         for (final Connection conn : connectable.getIncomingConnections()) {
-            if (!conn.getFlowFileQueue().isEmpty()) {
+            if (!conn.getFlowFileQueue().isActiveQueueEmpty()) {
                 return true;
             }
         }


Mime
View raw message