accumulo-commits mailing list archives

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

Conflicts:
	test/src/test/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java


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

Branch: refs/heads/master
Commit: c91d713bb1ab36d4b89c6aee82f7fe10016513e7
Parents: 84a42bb 77066e3
Author: Keith Turner <kturner@apache.org>
Authored: Tue Jun 23 18:26:45 2015 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Tue Jun 23 18:26:45 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c91d713b/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
----------------------------------------------------------------------
diff --cc test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
index 0000000,0000000..e4e0962
new file mode 100644
--- /dev/null
+++ b/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
@@@ -1,0 -1,0 +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.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.trace.Tracer;
++import org.apache.accumulo.fate.util.UtilWaitThread;
++import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
++import org.apache.accumulo.test.functional.ConfigurableMacBase;
++import org.apache.hadoop.conf.Configuration;
++import org.junit.Test;
++
++import com.google.common.collect.Iterators;
++
++public class DetectDeadTabletServersIT extends ConfigurableMacBase {
++
++  @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));
++    ClientContext context = new ClientContext(c.getInstance(), creds, getClientConfig());
++    Client client = null;
++    try {
++      client = MasterClient.getConnectionWithRetry(context);
++      log.info("Fetching master stats");
++      return client.getMasterStats(Tracer.traceInfo(), context.rpcCreds());
++    } finally {
++      if (client != null) {
++        MasterClient.close(client);
++      }
++    }
++  }
++
++}


Mime
View raw message