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);
}
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);
}
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()]);
}
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);
}
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;
}
}
}
Aggregations