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 62E3711611 for ; Wed, 2 Jul 2014 20:07:03 +0000 (UTC) Received: (qmail 756 invoked by uid 500); 2 Jul 2014 20:07:03 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 722 invoked by uid 500); 2 Jul 2014 20:07:03 -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 713 invoked by uid 99); 2 Jul 2014 20:07:03 -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, 02 Jul 2014 20:07:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 004DD9946FA; Wed, 2 Jul 2014 20:07:02 +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 Message-Id: <28cecf8fe85c4e588fb8408125a1f343@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: ACCUMULO-2757 make sure we don't dramatically increase our zookeeeper watches Date: Wed, 2 Jul 2014 20:07:02 +0000 (UTC) Repository: accumulo Updated Branches: refs/heads/master ef0866db4 -> 996441f8b ACCUMULO-2757 make sure we don't dramatically increase our zookeeeper watches Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/996441f8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/996441f8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/996441f8 Branch: refs/heads/master Commit: 996441f8bacf8cc8b1dbb1b32554c22103e9a3ee Parents: ef0866d Author: Eric C. Newton Authored: Wed Jul 2 16:06:35 2014 -0400 Committer: Eric C. Newton Committed: Wed Jul 2 16:06:35 2014 -0400 ---------------------------------------------------------------------- .../test/functional/WatchTheWatchCountIT.java | 62 ++++++++++++++++++++ 1 file changed, 62 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/996441f8/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java new file mode 100644 index 0000000..461e0f7 --- /dev/null +++ b/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.test.functional; + +import static org.junit.Assert.assertTrue; + +import java.net.Socket; + +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; +import org.apache.hadoop.conf.Configuration; +import org.junit.Test; + +import com.google.common.net.HostAndPort; + +// ACCUMULO-2757 - make sure we don't make too many more watchers +public class WatchTheWatchCountIT extends ConfigurableMacIT { + + @Override + public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { + cfg.setNumTservers(3); + } + + @Test(timeout = 30 * 1000) + public void test() throws Exception { + Connector c = getConnector(); + for (String tableName : this.getUniqueNames(3)) { + c.tableOperations().create(tableName); + } + c.tableOperations().list(); + String zooKeepers = c.getInstance().getZooKeepers(); + HostAndPort hostAndPort = HostAndPort.fromString(zooKeepers); + Socket socket = new Socket(hostAndPort.getHostText(), hostAndPort.getPort()); + try { + socket.getOutputStream().write("wchs\n".getBytes(), 0, 5); + byte[] buffer = new byte[1024]; + int n = socket.getInputStream().read(buffer); + String response = new String(buffer, 0, n); + long total = Long.parseLong(response.split(":")[1].trim()); + assertTrue(total > 500); + assertTrue(total < 600); + } finally { + socket.close(); + } + } + + +}