accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [4/4] accumulo git commit: Merge branch '1.6' into 1.7
Date Tue, 23 Jun 2015 22:37:24 GMT
Merge branch '1.6' into 1.7

Conflicts:
	test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
	test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
	test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/77066e35
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/77066e35
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/77066e35

Branch: refs/heads/1.7
Commit: 77066e35c3778fee18ef17be9c82322f0660138c
Parents: 8dd229c fc15de7
Author: Keith Turner <kturner@apache.org>
Authored: Tue Jun 23 18:11:31 2015 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Tue Jun 23 18:11:31 2015 -0400

----------------------------------------------------------------------
 .../accumulo/test/DetectDeadTabletServers.java  |  98 -----------------
 .../randomwalk/concurrent/CheckBalance.java     | 110 -------------------
 .../concurrent/ConcurrentFixture.java           |   5 +-
 .../test/randomwalk/concurrent/Config.java      |   2 +-
 .../test/DetectDeadTabletServersIT.java         |  97 ++++++++++++++++
 .../randomwalk/conf/modules/Concurrent.xml      |   5 -
 6 files changed, 99 insertions(+), 218 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/77066e35/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
----------------------------------------------------------------------
diff --cc test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
index a32e463,7963c8b..b27f34c
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
@@@ -34,13 -33,11 +34,10 @@@ import org.apache.hadoop.io.Text
  public class ConcurrentFixture extends Fixture {
  
    @Override
 -  public void setUp(State state) throws Exception {}
 +  public void setUp(State state, Environment env) throws Exception {}
  
    @Override
-   public void tearDown(State state, Environment env) throws Exception {
-     state.remove(CheckBalance.LAST_UNBALANCED_TIME);
-     state.remove(CheckBalance.UNBALANCED_COUNT);
 -  public void tearDown(State state) throws Exception {
--  }
++  public void tearDown(State state, Environment env) throws Exception {}
  
    /**
     *

http://git-wip-us.apache.org/repos/asf/accumulo/blob/77066e35/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
----------------------------------------------------------------------
diff --cc test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
index 6e02c23,1f4a284..7e95d3b
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Config.java
@@@ -201,7 -201,7 +201,7 @@@ public class Config extends Test 
      Setting setting = tableSettings[choice];
  
      // pick a random table
-     SortedSet<String> namespaces = env.getConnector().namespaceOperations().list();
 -    SortedSet<String> namespaces = state.getConnector().namespaceOperations().list().tailSet("nspc").headSet("nspd");
++    SortedSet<String> namespaces = env.getConnector().namespaceOperations().list().tailSet("nspc").headSet("nspd");
      if (namespaces.isEmpty())
        return;
      String namespace = random.nextSample(namespaces, 1)[0].toString();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/77066e35/test/src/test/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
----------------------------------------------------------------------
diff --cc test/src/test/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
index 0000000,11fa06b..04c781b
mode 000000,100644..100644
--- a/test/src/test/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
@@@ -1,0 -1,96 +1,97 @@@
+ /*
+  * 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.apache.accumulo.minicluster.ServerType.TABLET_SERVER;
+ import static org.junit.Assert.assertEquals;
+ 
+ import org.apache.accumulo.core.client.Connector;
++import org.apache.accumulo.core.client.impl.ClientContext;
++import org.apache.accumulo.core.client.impl.Credentials;
+ import org.apache.accumulo.core.client.impl.MasterClient;
+ import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+ import org.apache.accumulo.core.conf.Property;
 -import org.apache.accumulo.core.master.thrift.MasterClientService;
++import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
+ import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
+ import org.apache.accumulo.core.metadata.MetadataTable;
+ import org.apache.accumulo.core.security.Authorizations;
 -import org.apache.accumulo.core.security.Credentials;
++import org.apache.accumulo.core.trace.Tracer;
+ import org.apache.accumulo.fate.util.UtilWaitThread;
+ import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
+ import org.apache.accumulo.test.functional.ConfigurableMacIT;
 -import org.apache.accumulo.trace.instrument.Tracer;
+ import org.apache.hadoop.conf.Configuration;
+ import org.junit.Test;
+ 
+ import com.google.common.collect.Iterators;
+ 
+ public class DetectDeadTabletServersIT extends ConfigurableMacIT {
+ 
+   @Override
+   protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
+     cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "3s");
+   }
+ 
+   @Test
+   public void test() throws Exception {
+     Connector c = getConnector();
+     log.info("verifying that everything is up");
+     Iterators.size(c.createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator());
+ 
+     MasterMonitorInfo stats = getStats(c);
+     assertEquals(2, stats.tServerInfo.size());
+     assertEquals(0, stats.badTServers.size());
+     assertEquals(0, stats.deadTabletServers.size());
+     log.info("Killing a tablet server");
+     getCluster().killProcess(TABLET_SERVER, getCluster().getProcesses().get(TABLET_SERVER).iterator().next());
+ 
+     while (true) {
+       stats = getStats(c);
+       if (2 != stats.tServerInfo.size()) {
+         break;
+       }
+       UtilWaitThread.sleep(500);
+     }
+     assertEquals(1, stats.tServerInfo.size());
+     assertEquals(1, stats.badTServers.size() + stats.deadTabletServers.size());
+     while (true) {
+       stats = getStats(c);
+       if (0 != stats.deadTabletServers.size()) {
+         break;
+       }
+       UtilWaitThread.sleep(500);
+     }
+     assertEquals(1, stats.tServerInfo.size());
+     assertEquals(0, stats.badTServers.size());
+     assertEquals(1, stats.deadTabletServers.size());
+   }
+ 
+   private MasterMonitorInfo getStats(Connector c) throws Exception {
+     Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD));
 -    MasterClientService.Iface client = null;
++    ClientContext context = new ClientContext(c.getInstance(), creds, getClientConfig());
++    Client client = null;
+     try {
 -      client = MasterClient.getConnectionWithRetry(c.getInstance());
++      client = MasterClient.getConnectionWithRetry(context);
+       log.info("Fetching master stats");
 -      return client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.getInstance()));
++      return client.getMasterStats(Tracer.traceInfo(), context.rpcCreds());
+     } finally {
+       if (client != null) {
+         MasterClient.close(client);
+       }
+     }
+   }
+ 
 -
+ }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/77066e35/test/system/randomwalk/conf/modules/Concurrent.xml
----------------------------------------------------------------------


Mime
View raw message