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:45 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 0013e46e6 -> 01234bef3


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

Branch: refs/heads/1.7
Commit: 747a1901cc964e61ffd7f32b0b4302b28397a615
Parents: f50db38 4b5ea53
Author: Eric C. Newton <eric.newton@gmail.com>
Authored: Fri Oct 2 13:15:15 2015 -0400
Committer: Eric C. Newton <eric.newton@gmail.com>
Committed: Fri Oct 2 14:21:27 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/747a1901/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
----------------------------------------------------------------------
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index bbb6536,1e7c086..f87131e
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@@ -48,9 -35,15 +48,15 @@@ class CompactionQueue extends AbstractQ
      if (task.size() == 0)
        return null;
  
 -    Comparable min = Collections.min(task);
 -    Iterator<Comparable> iterator = task.iterator();
 +    TraceRunnable min = Collections.min(task, comparator);
-     task.remove(min);
-     return min;
++    Iterator<TraceRunnable> iterator = task.iterator();
+     while (iterator.hasNext()) {
+       if (iterator.next() == min) {
+         iterator.remove();
 -        return (Runnable) min;
++        return min;
+       }
+     }
+     throw new IllegalStateException("Minimum object found, but not there when removing");
    }
  
    @Override


Mime
View raw message