You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2015/10/02 19:16:07 UTC
[3/5] accumulo git commit: ACCUMULO-3462 use object reference
equality to remove the minimum object queued
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/master
Commit: 4b5ea535516d98ac482e33e210a6c48fb8f12c43
Parents: 7a1d6d9
Author: Eric C. Newton <er...@gmail.com>
Authored: Fri Oct 2 13:09:57 2015 -0400
Committer: Eric C. Newton <er...@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