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-3462 use object reference equality to remove the minimum object queued
Date Fri, 02 Oct 2015 17:15:56 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 f50db38f7 -> 0013e46e6


ACCUMULO-3462 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/4b5ea535
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4b5ea535
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4b5ea535

Branch: refs/heads/1.7
Commit: 4b5ea535516d98ac482e33e210a6c48fb8f12c43
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 13:09:57 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/4b5ea535/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