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 311A910F71 for ; Wed, 28 May 2014 00:40:42 +0000 (UTC) Received: (qmail 73887 invoked by uid 500); 28 May 2014 00:40:42 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 73858 invoked by uid 500); 28 May 2014 00:40:42 -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 73705 invoked by uid 99); 28 May 2014 00:40:42 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 May 2014 00:40:42 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AD04A8359A4; Wed, 28 May 2014 00:40:41 +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: Wed, 28 May 2014 00:40:44 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/13] 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/ACCUMULO-378 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();