本文整理了Java中org.apache.hadoop.hbase.client.Admin.shutdown()
方法的一些代码示例,展示了Admin.shutdown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.shutdown()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:shutdown
[英]Shuts down the HBase cluster
[中]关闭HBase群集
代码示例来源:origin: apache/hbase
@SuppressWarnings("resource")
private int stopMaster() {
Configuration conf = getConf();
// Don't try more than once
conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 0);
try (Connection connection = ConnectionFactory.createConnection(conf)) {
try (Admin admin = connection.getAdmin()) {
admin.shutdown();
} catch (Throwable t) {
LOG.error("Failed to stop master", t);
return 1;
}
} catch (MasterNotRunningException e) {
LOG.error("Master not running");
return 1;
} catch (ZooKeeperConnectionException e) {
LOG.error("ZooKeeper not available");
return 1;
} catch (IOException e) {
LOG.error("Got IOException: " +e.getMessage(), e);
return 1;
}
return 0;
}
代码示例来源:origin: apache/hbase
@Override
public void run() {
LOG.info("Before call to shutdown master");
try {
try (
Connection connection = ConnectionFactory.createConnection(util.getConfiguration())) {
try (Admin admin = connection.getAdmin()) {
admin.shutdown();
}
}
} catch (Exception e) {
LOG.info("Error while calling Admin.shutdown, which is expected: " + e.getMessage());
}
LOG.info("After call to shutdown master");
cluster.waitOnMaster(MASTER_INDEX);
}
};
代码示例来源:origin: apache/hbase
hasAccess = false;
LOG.info("Stopping HMaster...");
admin.shutdown();
} catch (AccessDeniedException e) {
LOG.error("Exception occurred while stopping HMaster. ", e);
代码示例来源:origin: com.sitewhere/sitewhere-hbase
/**
* Stop all connectivity. TODO: Where does this eventually get called?
*/
public void stop() {
if (getAdmin() != null) {
try {
getAdmin().shutdown();
} catch (IOException e) {
LOGGER.error("HBaseAdmin did not shut down cleanly.", e);
}
}
try {
getConnection().close();
} catch (IOException e) {
LOGGER.error("HConnection did not close cleanly.", e);
}
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Override
public void run() {
LOG.info("Before call to shutdown master");
try {
try (
Connection connection = ConnectionFactory.createConnection(util.getConfiguration())) {
try (Admin admin = connection.getAdmin()) {
admin.shutdown();
}
}
} catch (Exception e) {
LOG.info("Error while calling Admin.shutdown, which is expected: " + e.getMessage());
}
LOG.info("After call to shutdown master");
cluster.waitOnMaster(MASTER_INDEX);
}
};
代码示例来源:origin: harbby/presto-connectors
adm.shutdown();
} catch (MasterNotRunningException e) {
LOG.error("Master not running");
代码示例来源:origin: org.apache.hbase/hbase-server
hasAccess = false;
LOG.info("Stopping HMaster...");
admin.shutdown();
} catch (AccessDeniedException e) {
LOG.error("Exception occurred while stopping HMaster. ", e);
内容来源于网络,如有侵权,请联系作者删除!