nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joew...@apache.org
Subject [2/2] nifi git commit: NIFI-1279: Take the FlowFile's 1-up id into account for the newest and oldest flowfile prioritizers
Date Fri, 18 Dec 2015 17:55:02 GMT
NIFI-1279: Take the FlowFile's 1-up id into account for the newest and oldest flowfile prioritizers

Signed-off-by: joewitt <joewitt@apache.org>


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

Branch: refs/heads/master
Commit: bd4f31a4c20e104aa886edfe643b7eb175046467
Parents: 1869b44
Author: Mark Payne <markap14@hotmail.com>
Authored: Fri Dec 18 11:20:37 2015 -0500
Committer: joewitt <joewitt@apache.org>
Committed: Fri Dec 18 12:08:31 2015 -0500

----------------------------------------------------------------------
 .../nifi/prioritizer/NewestFlowFileFirstPrioritizer.java      | 7 ++++++-
 .../nifi/prioritizer/OldestFlowFileFirstPrioritizer.java      | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/bd4f31a4/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/NewestFlowFileFirstPrioritizer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/NewestFlowFileFirstPrioritizer.java
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/NewestFlowFileFirstPrioritizer.java
index 9b2ffdd..515993e 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/NewestFlowFileFirstPrioritizer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/NewestFlowFileFirstPrioritizer.java
@@ -31,7 +31,12 @@ public class NewestFlowFileFirstPrioritizer implements FlowFilePrioritizer
{
             return 1;
         }
 
-        return Long.compare(o2.getLineageStartDate(), o1.getLineageStartDate());
+        final int lineageDateCompare = Long.compare(o2.getLineageStartDate(), o1.getLineageStartDate());
+        if (lineageDateCompare != 0) {
+            return lineageDateCompare;
+        }
+
+        return Long.compare(o2.getId(), o1.getId());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/nifi/blob/bd4f31a4/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/OldestFlowFileFirstPrioritizer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/OldestFlowFileFirstPrioritizer.java
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/OldestFlowFileFirstPrioritizer.java
index bd0e5a8..b4781f3 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/OldestFlowFileFirstPrioritizer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-prioritizers/src/main/java/org/apache/nifi/prioritizer/OldestFlowFileFirstPrioritizer.java
@@ -31,7 +31,12 @@ public class OldestFlowFileFirstPrioritizer implements FlowFilePrioritizer
{
             return 1;
         }
 
-        return Long.compare(o1.getLineageStartDate(), o2.getLineageStartDate());
+        final int lineageDateCompare = Long.compare(o1.getLineageStartDate(), o2.getLineageStartDate());
+        if (lineageDateCompare != 0) {
+            return lineageDateCompare;
+        }
+
+        return Long.compare(o1.getId(), o2.getId());
     }
 
 }


Mime
View raw message