accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/2] accumulo git commit: ACCUMULO-4016 use object reference equality to remove the minimum object queued
Date Fri, 02 Oct 2015 18:22:36 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 4b5ea5355 -> a922ed791


ACCUMULO-4016 use object reference equality to remove the minimum object queued


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

Branch: refs/heads/1.6
Commit: fbb082d962aa472240ffccce753c5b4309fd5a46
Parents: 7a1d6d9
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Fri Oct 2 14:20:32 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/tserver/CompactionQueue.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/fbb082d9/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index 0cb04a7..1e7c086 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -36,8 +36,14 @@ public class CompactionQueue extends AbstractQueue<Runnable> implements
Blocking
       return null;
 
     Comparable min = Collections.min(task);
-    task.remove(min);
-    return (Runnable) min;
+    Iterator<Comparable> iterator = task.iterator();
+    while (iterator.hasNext()) {
+      if (iterator.next() == min) {
+        iterator.remove();
+        return (Runnable) min;
+      }
+    }
+    throw new IllegalStateException("Minimum object found, but not there when removing");
   }
 
   @Override


Mime
View raw message