Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 49B0918D2F for ; Fri, 2 Oct 2015 17:16:06 +0000 (UTC) Received: (qmail 82439 invoked by uid 500); 2 Oct 2015 17:16:06 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 82339 invoked by uid 500); 2 Oct 2015 17:16:06 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 82232 invoked by uid 99); 2 Oct 2015 17:16:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2015 17:16:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F3154DFCF2; Fri, 2 Oct 2015 17:16:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ecn@apache.org To: commits@accumulo.apache.org Date: Fri, 02 Oct 2015 17:16:07 -0000 Message-Id: In-Reply-To: <8c494d14cc1646a8977763b2f68c9fad@git.apache.org> References: <8c494d14cc1646a8977763b2f68c9fad@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Fri Oct 2 13:09:57 2015 -0400 Committer: Eric C. Newton 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 implements Blocking return null; Comparable min = Collections.min(task); - task.remove(min); - return (Runnable) min; + Iterator 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