accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ibe...@apache.org
Subject [1/4] accumulo git commit: ACCUMULO-4602 Deleted AssignmentThreadsIT
Date Thu, 20 Jul 2017 18:46:10 GMT
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 <mmiller@apache.org>
Authored: Wed Jul 19 17:16:39 2017 -0400
Committer: Mike Miller <mmiller@apache.org>
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<Text> 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<Text> 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);
     }


Mime
View raw message