drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [2/5] drill git commit: DRILL-5094: Comparator should guarantee transitive attribute.
Date Sun, 04 Dec 2016 19:21:14 GMT
DRILL-5094: Comparator should guarantee transitive attribute.

close apache/drill#675


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

Branch: refs/heads/master
Commit: db9d1b1e85e06197ef197c773394dfa724c1259c
Parents: 63ffeff
Author: chunhui-shi <cshi@maprtech.com>
Authored: Thu Dec 1 17:55:12 2016 -0800
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Fri Dec 2 08:38:56 2016 -0800

----------------------------------------------------------------------
 .../org/apache/drill/exec/store/schedule/AssignmentCreator.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/db9d1b1e/exec/java-exec/src/main/java/org/apache/drill/exec/store/schedule/AssignmentCreator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/schedule/AssignmentCreator.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/schedule/AssignmentCreator.java
index eed200e..127264a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/schedule/AssignmentCreator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/schedule/AssignmentCreator.java
@@ -50,7 +50,8 @@ public class AssignmentCreator<T extends CompleteWork> {
   private static Comparator<Entry<DrillbitEndpoint,Long>> comparator = new Comparator<Entry<DrillbitEndpoint,Long>>()
{
     @Override
     public int compare(Entry<DrillbitEndpoint, Long> o1, Entry<DrillbitEndpoint,Long>
o2) {
-      return (int) (o1.getValue() - o2.getValue());
+      long ret = o1.getValue() - o2.getValue();
+      return ret > 0? 1 : ((ret < 0)? -1: 0);
     }
   };
 


Mime
View raw message