本文整理汇总了Java中org.apache.hadoop.hbase.master.handler.DeleteTableHandler类的典型用法代码示例。如果您正苦于以下问题:Java DeleteTableHandler类的具体用法?Java DeleteTableHandler怎么用?Java DeleteTableHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DeleteTableHandler类属于org.apache.hadoop.hbase.master.handler包,在下文中一共展示了DeleteTableHandler类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disableAndDeleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
private void disableAndDeleteTable(MasterServices master, TableName tableName) throws IOException {
LOG.error(tableName + " already exists. Disabling and deleting table " + tableName + '.');
boolean disabled = master.getAssignmentManager().getZKTable().isDisabledTable(tableName);
if (false == disabled) {
LOG.info("Disabling table " + tableName + '.');
new DisableTableHandler(master, tableName, master.getCatalogTracker(),
master.getAssignmentManager(), master.getTableLockManager(), false).prepare().process();
if (false == master.getAssignmentManager().getZKTable().isDisabledTable(tableName)) {
throw new DoNotRetryIOException("Table " + tableName + " not disabled.");
}
}
LOG.info("Disabled table " + tableName + '.');
LOG.info("Deleting table " + tableName + '.');
new DeleteTableHandler(tableName, master, master).prepare().process();
if (true == MetaReader.tableExists(master.getCatalogTracker(), tableName)) {
throw new DoNotRetryIOException("Table " + tableName + " not deleted.");
}
LOG.info("Deleted table " + tableName + '.');
}
示例2: postDeleteTableHandler
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void postDeleteTableHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName) throws IOException {
LOG.info("Entered into postDeleteTableHandler of table " + tableName + '.');
MasterServices master = ctx.getEnvironment().getMasterServices();
TableName indexTableName = TableName.valueOf(IndexUtils.getIndexTableName(tableName));
boolean indexTablePresent =
master.getAssignmentManager().getZKTable().isTablePresent(indexTableName);
// Not checking for disabled state because before deleting user table both user and index table
// should be disabled.
if ((!IndexUtils.isIndexTable(tableName)) && indexTablePresent) {
LoadBalancer balancer = master.getAssignmentManager().getBalancer();
if (balancer instanceof SecIndexLoadBalancer) {
((SecIndexLoadBalancer) balancer).removeIndexedTable(tableName);
}
DeleteTableHandler dth = new DeleteTableHandler(indexTableName, master, master);
dth.prepare();
dth.process();
}
LOG.info("Exiting from postDeleteTableHandler of table " + tableName + '.');
}
示例3: disableAndDeleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
private void disableAndDeleteTable(MasterServices master, String tableName) throws IOException {
byte[] tableNameInBytes = Bytes.toBytes(tableName);
LOG.error(tableName + " already exists. Disabling and deleting table " + tableName + '.');
boolean disabled = master.getAssignmentManager().getZKTable().isDisabledTable(tableName);
if (false == disabled) {
LOG.info("Disabling table " + tableName + '.');
new DisableTableHandler(master, tableNameInBytes, master.getCatalogTracker(),
master.getAssignmentManager(), false).process();
if (false == master.getAssignmentManager().getZKTable().isDisabledTable(tableName)) {
throw new IOException("Table " + tableName + " not disabled.");
}
}
LOG.info("Disabled table " + tableName + '.');
LOG.info("Deleting table " + tableName + '.');
new DeleteTableHandler(tableNameInBytes, master, master).process();
if (true == MetaReader.tableExists(master.getCatalogTracker(), tableName)) {
throw new IOException("Table " + tableName + " not deleted.");
}
LOG.info("Deleted table " + tableName + '.');
}
示例4: deleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void deleteTable(final byte [] tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDeleteTable(tableName);
}
this.executorService.submit(new DeleteTableHandler(tableName, this, this));
if (cpHost != null) {
cpHost.postDeleteTable(tableName);
}
}
示例5: deleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void deleteTable(final TableName tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDeleteTable(tableName);
}
LOG.info(getClientIdAuditPrefix() + " delete " + tableName);
this.service.submit(new DeleteTableHandler(tableName, this, this).prepare());
if (cpHost != null) {
cpHost.postDeleteTable(tableName);
}
}
示例6: deleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void deleteTable(final TableName tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDeleteTable(tableName);
}
LOG.info(getClientIdAuditPrefix() + " delete " + tableName);
this.executorService.submit(new DeleteTableHandler(tableName, this, this).prepare());
if (cpHost != null) {
cpHost.postDeleteTable(tableName);
}
}
示例7: deleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void deleteTable(final byte [] tableName) throws IOException {
if (cpHost != null) {
cpHost.preDeleteTable(tableName);
}
this.executorService.submit(new DeleteTableHandler(tableName, this, this));
if (cpHost != null) {
cpHost.postDeleteTable(tableName);
}
}
示例8: deleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void deleteTable(final TableName tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDeleteTable(tableName);
}
LOG.info(getClientIdAuditPrefix() + " delete " + tableName);
this.service.submit(new DeleteTableHandler(tableName, this, this).prepare());
if (cpHost != null) {
cpHost.postDeleteTable(tableName);
}
}
示例9: deleteTable
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void deleteTable(final byte[] tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDeleteTable(tableName);
}
this.executorService.submit(new DeleteTableHandler(tableName, this, this));
if (cpHost != null) {
cpHost.postDeleteTable(tableName);
}
}
示例10: postDeleteTableHandler
import org.apache.hadoop.hbase.master.handler.DeleteTableHandler; //导入依赖的package包/类
@Override
public void postDeleteTableHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
LOG.info("Entered into postDeleteTableHandler of table " + Bytes.toString(tableName) + '.');
MasterServices master = ctx.getEnvironment().getMasterServices();
String indexTableName = IndexUtils.getIndexTableName(tableName);
boolean indexTablePresent =
master.getAssignmentManager().getZKTable().isTablePresent(indexTableName);
// Not checking for disabled state because before deleting user table both user and index table
// should be disabled.
if ((false == IndexUtils.isIndexTable(Bytes.toString(tableName))) && indexTablePresent) {
new DeleteTableHandler(Bytes.toBytes(indexTableName), master, master).process();
}
LOG.info("Exiting from postDeleteTableHandler of table " + Bytes.toString(tableName) + '.');
}