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 BB7BD11181 for ; Sat, 14 Jun 2014 04:55:04 +0000 (UTC) Received: (qmail 49332 invoked by uid 500); 14 Jun 2014 04:55:04 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 49297 invoked by uid 500); 14 Jun 2014 04:55:04 -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 49218 invoked by uid 99); 14 Jun 2014 04:55:04 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jun 2014 04:55:04 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 583269348F4; Sat, 14 Jun 2014 04:55:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Sat, 14 Jun 2014 04:55:06 -0000 Message-Id: <9410a6eca1524071b37c8463945ff4b9@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/51] [abbrv] git commit: ACCUMULO-2582 Use the DistributedWorkQueue to list the children instead of doing it by hand. ACCUMULO-2582 Use the DistributedWorkQueue to list the children instead of doing it by hand. The DistributedWorkQueue also has a node for handling the locking of the children. We don't want to use that, and the name of the node is not public information. So, we should just use the queue instead of doing it by hand. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/cd78169d Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/cd78169d Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/cd78169d Branch: refs/heads/master Commit: cd78169d8925bef610331f74231cd03e8cb91323 Parents: 0f95206 Author: Josh Elser Authored: Tue May 27 16:51:25 2014 -0400 Committer: Josh Elser Committed: Tue May 27 16:51:25 2014 -0400 ---------------------------------------------------------------------- .../accumulo/monitor/servlets/ReplicationServlet.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/cd78169d/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java index 45f6baf..6fc8eed 100644 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java @@ -19,7 +19,6 @@ package org.apache.accumulo.monitor.servlets; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; @@ -49,12 +48,13 @@ import org.apache.accumulo.core.replication.proto.Replication.Status; import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.Credentials; import org.apache.accumulo.core.zookeeper.ZooUtil; -import org.apache.accumulo.fate.zookeeper.ZooReader; import org.apache.accumulo.monitor.util.Table; import org.apache.accumulo.monitor.util.celltypes.NumberType; import org.apache.accumulo.server.client.HdfsZooInstance; +import org.apache.accumulo.server.conf.ServerConfiguration; import org.apache.accumulo.server.replication.AbstractWorkAssigner; import org.apache.accumulo.server.security.SystemCredentials; +import org.apache.accumulo.server.zookeeper.DistributedWorkQueue; import org.apache.accumulo.server.zookeeper.ZooCache; import org.apache.hadoop.io.Text; import org.slf4j.Logger; @@ -202,13 +202,13 @@ public class ReplicationServlet extends BasicServlet { replicationInProgress.addSortableColumn("Peer Identifier"); replicationInProgress.addUnsortableColumn("Status"); - String zkRoot = ZooUtil.getRoot(inst); - ZooReader zreader = new ZooReader(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut()); - // Read the files from the workqueue in zk + String zkRoot = ZooUtil.getRoot(inst); final String workQueuePath = zkRoot + Constants.ZREPLICATION_WORK_QUEUE; - List queuedReplication = zreader.getChildren(workQueuePath); - for (String queueKey : queuedReplication) { + + DistributedWorkQueue workQueue = new DistributedWorkQueue(workQueuePath, ServerConfiguration.getSystemConfiguration(inst)); + + for (String queueKey : workQueue.getWorkQueued()) { Entry entry = AbstractWorkAssigner.fromQueueKey(queueKey); String filename = entry.getKey(); ReplicationTarget target = entry.getValue();