Search in sources :

Example 46 with ServerName

use of org.apache.hadoop.hbase.ServerName in project hbase by apache.

the class RestartActiveMasterAction method perform.

@Override
public void perform() throws Exception {
    LOG.info("Performing action: Restart active master");
    ServerName master = cluster.getClusterStatus().getMaster();
    restartMaster(master, sleepTime);
}
Also used : ServerName(org.apache.hadoop.hbase.ServerName)

Example 47 with ServerName

use of org.apache.hadoop.hbase.ServerName in project hbase by apache.

the class RestartRandomDataNodeAction method perform.

@Override
public void perform() throws Exception {
    LOG.info("Performing action: Restart random data node");
    ServerName server = PolicyBasedChaosMonkey.selectRandomItem(getDataNodes());
    restartDataNode(server, sleepTime);
}
Also used : ServerName(org.apache.hadoop.hbase.ServerName)

Example 48 with ServerName

use of org.apache.hadoop.hbase.ServerName in project hbase by apache.

the class RestartRandomDataNodeAction method getDataNodes.

public ServerName[] getDataNodes() throws IOException {
    DistributedFileSystem fs = (DistributedFileSystem) FSUtils.getRootDir(getConf()).getFileSystem(getConf());
    DFSClient dfsClient = fs.getClient();
    List<ServerName> hosts = new LinkedList<>();
    for (DatanodeInfo dataNode : dfsClient.datanodeReport(HdfsConstants.DatanodeReportType.LIVE)) {
        hosts.add(ServerName.valueOf(dataNode.getHostName(), -1, -1));
    }
    return hosts.toArray(new ServerName[hosts.size()]);
}
Also used : DFSClient(org.apache.hadoop.hdfs.DFSClient) DatanodeInfo(org.apache.hadoop.hdfs.protocol.DatanodeInfo) ServerName(org.apache.hadoop.hbase.ServerName) DistributedFileSystem(org.apache.hadoop.hdfs.DistributedFileSystem) LinkedList(java.util.LinkedList)

Example 49 with ServerName

use of org.apache.hadoop.hbase.ServerName in project hbase by apache.

the class RestartRandomRsAction method perform.

@Override
public void perform() throws Exception {
    LOG.info("Performing action: Restart random region server");
    ServerName server = PolicyBasedChaosMonkey.selectRandomItem(getCurrentServers());
    restartRs(server, sleepTime);
}
Also used : ServerName(org.apache.hadoop.hbase.ServerName)

Example 50 with ServerName

use of org.apache.hadoop.hbase.ServerName in project hbase by apache.

the class RestartRandomRsExceptMetaAction method perform.

@Override
public void perform() throws Exception {
    int tries = 10;
    while (tries-- > 0 && getCurrentServers().length > 1) {
        ServerName server = PolicyBasedChaosMonkey.selectRandomItem(getCurrentServers());
        ServerName metaServer = cluster.getServerHoldingMeta();
        if (server != null && !server.equals(metaServer)) {
            restartRs(server, sleepTime);
            break;
        }
    }
}
Also used : ServerName(org.apache.hadoop.hbase.ServerName)

Aggregations

ServerName (org.apache.hadoop.hbase.ServerName)426 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)202 Test (org.junit.Test)163 ArrayList (java.util.ArrayList)97 TableName (org.apache.hadoop.hbase.TableName)89 IOException (java.io.IOException)87 HashMap (java.util.HashMap)81 List (java.util.List)72 Map (java.util.Map)54 HRegionLocation (org.apache.hadoop.hbase.HRegionLocation)45 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)34 Table (org.apache.hadoop.hbase.client.Table)33 HashSet (java.util.HashSet)32 TreeMap (java.util.TreeMap)31 HColumnDescriptor (org.apache.hadoop.hbase.HColumnDescriptor)29 Configuration (org.apache.hadoop.conf.Configuration)26 HRegionServer (org.apache.hadoop.hbase.regionserver.HRegionServer)26 Pair (org.apache.hadoop.hbase.util.Pair)24 KeeperException (org.apache.zookeeper.KeeperException)23 InterruptedIOException (java.io.InterruptedIOException)22