Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CEC11200CCB for ; Thu, 20 Jul 2017 20:46:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CD24416BDC9; Thu, 20 Jul 2017 18:46:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00B2416BDC4 for ; Thu, 20 Jul 2017 20:46:12 +0200 (CEST) Received: (qmail 47155 invoked by uid 500); 20 Jul 2017 18:46:12 -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 47111 invoked by uid 99); 20 Jul 2017 18:46:10 -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; Thu, 20 Jul 2017 18:46:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B8082DFF63; Thu, 20 Jul 2017 18:46:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ibella@apache.org To: commits@accumulo.apache.org Date: Thu, 20 Jul 2017 18:46:10 -0000 Message-Id: <927b4d89f0b049d99514445212947b14@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/4] accumulo git commit: ACCUMULO-4602 Deleted AssignmentThreadsIT archived-at: Thu, 20 Jul 2017 18:46:14 -0000 Repository: accumulo Updated Branches: refs/heads/master 78f4dc69e -> 1910e25be ACCUMULO-4602 Deleted AssignmentThreadsIT Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/818e56bb Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/818e56bb Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/818e56bb Branch: refs/heads/master Commit: 818e56bb54499079bf86ad80e5e619b248d6ff69 Parents: b7d9be0 Author: Mike Miller Authored: Wed Jul 19 17:16:39 2017 -0400 Committer: Mike Miller Committed: Wed Jul 19 18:14:41 2017 -0400 ---------------------------------------------------------------------- .../accumulo/test/AssignmentThreadsIT.java | 98 -------------------- .../accumulo/test/VerifySerialRecoveryIT.java | 20 +++- 2 files changed, 18 insertions(+), 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/818e56bb/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java b/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java deleted file mode 100644 index 3778de6..0000000 --- a/test/src/test/java/org/apache/accumulo/test/AssignmentThreadsIT.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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; - -import static org.junit.Assert.assertTrue; - -import java.util.Random; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.apache.accumulo.core.client.Connector; -import org.apache.accumulo.core.conf.Property; -import org.apache.accumulo.core.util.UtilWaitThread; -import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; -import org.apache.accumulo.test.functional.ConfigurableMacIT; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.io.Text; -import org.junit.Test; - -// ACCUMULO-1177 -public class AssignmentThreadsIT extends ConfigurableMacIT { - - @Override - public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - cfg.setNumTservers(1); - cfg.setProperty(Property.TSERV_ASSIGNMENT_MAXCONCURRENT, "1"); - } - - // [0-9a-f] - private final static byte[] HEXCHARS = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66}; - private final static Random random = new Random(); - - public static byte[] randomHex(int n) { - byte[] binary = new byte[n]; - byte[] hex = new byte[n * 2]; - random.nextBytes(binary); - int count = 0; - for (byte x : binary) { - hex[count++] = HEXCHARS[(x >> 4) & 0xf]; - hex[count++] = HEXCHARS[x & 0xf]; - } - return hex; - } - - @Test(timeout = 5 * 60 * 1000) - public void testConcurrentAssignmentPerformance() throws Exception { - // make a table with a lot of splits - String tableName = getUniqueNames(1)[0]; - Connector c = getConnector(); - log.info("Creating table"); - c.tableOperations().create(tableName); - SortedSet splits = new TreeSet<>(); - for (int i = 0; i < 1000; i++) { - splits.add(new Text(randomHex(8))); - } - log.info("Adding splits"); - c.tableOperations().addSplits(tableName, splits); - log.info("Taking table offline"); - c.tableOperations().offline(tableName, true); - - // time how long it takes to load - log.info("Bringing the table online"); - long now = System.nanoTime(); - c.tableOperations().online(tableName, true); - long diff = System.nanoTime() - now; - - log.info("Loaded " + splits.size() + " tablets in " + diff + " ns"); - c.instanceOperations().setProperty(Property.TSERV_ASSIGNMENT_MAXCONCURRENT.getKey(), "20"); - log.info("Taking table offline, again"); - c.tableOperations().offline(tableName, true); - // wait >10 seconds for thread pool to update - log.info("sleep for {} ms so thread pool can update", 60_000); - UtilWaitThread.sleep(60_000); - - log.info("Bringing table back online"); - now = System.nanoTime(); - c.tableOperations().online(tableName, true); - long diff2 = System.nanoTime() - now; - - log.debug("Loaded " + splits.size() + " tablets in " + diff2 + " ns"); - assertTrue(diff2 < diff); - } - -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/818e56bb/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java index 7def5fb..130e4b0 100644 --- a/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java +++ b/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java @@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.util.Random; import java.util.SortedSet; import java.util.TreeSet; @@ -44,6 +45,21 @@ import com.google.common.collect.Iterators; public class VerifySerialRecoveryIT extends ConfigurableMacIT { + private final static byte[] HEXCHARS = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66}; + private final static Random random = new Random(); + + public static byte[] randomHex(int n) { + byte[] binary = new byte[n]; + byte[] hex = new byte[n * 2]; + random.nextBytes(binary); + int count = 0; + for (byte x : binary) { + hex[count++] = HEXCHARS[(x >> 4) & 0xf]; + hex[count++] = HEXCHARS[x & 0xf]; + } + return hex; + } + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setNumTservers(1); @@ -60,13 +76,13 @@ public class VerifySerialRecoveryIT extends ConfigurableMacIT { c.tableOperations().create(tableName); SortedSet splits = new TreeSet<>(); for (int i = 0; i < 200; i++) { - splits.add(new Text(AssignmentThreadsIT.randomHex(8))); + splits.add(new Text(randomHex(8))); } c.tableOperations().addSplits(tableName, splits); // load data to give the recovery something to do BatchWriter bw = c.createBatchWriter(tableName, null); for (int i = 0; i < 50000; i++) { - Mutation m = new Mutation(AssignmentThreadsIT.randomHex(8)); + Mutation m = new Mutation(randomHex(8)); m.put("", "", ""); bw.addMutation(m); }