本文整理汇总了Java中org.apache.hadoop.hbase.master.handler.DisableTableHandler类的典型用法代码示例。如果您正苦于以下问题:Java DisableTableHandler类的具体用法?Java DisableTableHandler怎么用?Java DisableTableHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisableTableHandler类属于org.apache.hadoop.hbase.master.handler包,在下文中一共展示了DisableTableHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recoverTableInDisablingState
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
/**
* Recover the tables that were not fully moved to DISABLED state. These
* tables are in DISABLING state when the master restarted/switched.
*
* @throws KeeperException
* @throws TableNotFoundException
* @throws IOException
*/
private void recoverTableInDisablingState()
throws KeeperException, IOException, CoordinatedStateException {
Set<TableName> disablingTables =
tableStateManager.getTablesInStates(ZooKeeperProtos.Table.State.DISABLING);
if (disablingTables.size() != 0) {
for (TableName tableName : disablingTables) {
// Recover by calling DisableTableHandler
LOG.info("The table " + tableName
+ " is in DISABLING state. Hence recovering by moving the table"
+ " to DISABLED state.");
new DisableTableHandler(this.server, tableName,
this, tableLockManager, true).prepare().process();
}
}
}
示例2: recoverTableInDisablingState
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
/**
* Recover the tables that were not fully moved to DISABLED state. These
* tables are in DISABLING state when the master restarted/switched.
*
* @param disablingTables
* @return
* @throws KeeperException
* @throws TableNotFoundException
* @throws IOException
*/
private boolean recoverTableInDisablingState(Set<String> disablingTables)
throws KeeperException, TableNotFoundException, IOException {
boolean isWatcherCreated = false;
if (disablingTables.size() != 0) {
// Create a watcher on the zookeeper node
ZKUtil.listChildrenAndWatchForNewChildren(watcher,
watcher.assignmentZNode);
isWatcherCreated = true;
for (String tableName : disablingTables) {
// Recover by calling DisableTableHandler
LOG.info("The table " + tableName
+ " is in DISABLING state. Hence recovering by moving the table"
+ " to DISABLED state.");
new DisableTableHandler(this.master, tableName.getBytes(),
catalogTracker, this, true).process();
}
}
return isWatcherCreated;
}
示例3: disableAndDeleteTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的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 + '.');
}
示例4: recoverTableInDisablingState
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
/**
* Recover the tables that were not fully moved to DISABLED state. These
* tables are in DISABLING state when the master restarted/switched.
*
* @throws KeeperException
* @throws TableNotFoundException
* @throws IOException
*/
private void recoverTableInDisablingState()
throws KeeperException, IOException, CoordinatedStateException {
Set<TableName> disablingTables =
tableStateManager.getTablesInStates(ZooKeeperProtos.Table.State.DISABLING);
if (disablingTables.size() != 0) {
for (TableName tableName : disablingTables) {
// Recover by calling DisableTableHandler
LOG.info("The table " + tableName
+ " is in DISABLING state. Hence recovering by moving the table"
+ " to DISABLED state.");
new DisableTableHandler(this.server, tableName, catalogTracker,
this, tableLockManager, true).prepare().process();
}
}
}
示例5: disableAndDeleteTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的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 + '.');
}
示例6: disableTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
public void disableTable(final byte [] tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDisableTable(tableName);
}
this.executorService.submit(new DisableTableHandler(this, tableName,
catalogTracker, assignmentManager, false));
if (cpHost != null) {
cpHost.postDisableTable(tableName);
}
}
示例7: disableTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
@Override
public void disableTable(final TableName tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDisableTable(tableName);
}
LOG.info(getClientIdAuditPrefix() + " disable " + tableName);
this.service.submit(new DisableTableHandler(this, tableName,
assignmentManager, tableLockManager, false).prepare());
if (cpHost != null) {
cpHost.postDisableTable(tableName);
}
}
示例8: disableTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
@Override
public void disableTable(final TableName tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDisableTable(tableName);
}
LOG.info(getClientIdAuditPrefix() + " disable " + tableName);
this.executorService.submit(new DisableTableHandler(this, tableName,
catalogTracker, assignmentManager, tableLockManager, false).prepare());
if (cpHost != null) {
cpHost.postDisableTable(tableName);
}
}
示例9: recoverTableInDisablingState
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
/**
* Recover the tables that were not fully moved to DISABLED state. These
* tables are in DISABLING state when the master restarted/switched.
*
* @throws KeeperException
* @throws TableNotFoundException
* @throws IOException
*/
private void recoverTableInDisablingState()
throws KeeperException, TableNotFoundException, IOException {
Set<TableName> disablingTables = ZKTable.getDisablingTables(watcher);
if (disablingTables.size() != 0) {
for (TableName tableName : disablingTables) {
// Recover by calling DisableTableHandler
LOG.info("The table " + tableName
+ " is in DISABLING state. Hence recovering by moving the table"
+ " to DISABLED state.");
new DisableTableHandler(this.server, tableName, catalogTracker,
this, tableLockManager, true).prepare().process();
}
}
}
示例10: postDisableTableHandler
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
@Override
public void postDisableTableHandler(ObserverContext<MasterCoprocessorEnvironment> ctx,
TableName tableName) throws IOException {
LOG.info("Entered into postDisableTableHandler of table " + tableName);
MasterServices master = ctx.getEnvironment().getMasterServices();
AssignmentManager am = master.getAssignmentManager();
try {
if (!IndexUtils.isIndexTable(tableName.getNameAsString())) {
TableName indexTableName = TableName.valueOf(IndexUtils.getIndexTableName(tableName));
// Index table may not present following three cases.
// 1) Index details are not specified during table creation then index table wont be
// created.
// 2) Even we specify index details if master restarted in the middle of user table creation
// corresponding index table wont be created. But without creating index table user table
// wont
// be disabled. No need to call disable for index table at that time.
// 3) Index table may be deleted but this wont happen without deleting user table.
if (am.getZKTable().isTablePresent(indexTableName)) {
long timeout =
master.getConfiguration().getLong("hbase.bulk.assignment.waiton.empty.rit",
5 * 60 * 1000);
// Both user table and index table should not be in enabling/disabling state at a time.
// If disable is progress for user table then index table should be in ENABLED state.
// If enable is progress for index table wait until table enabled.
if (waitUntilTableEnabled(timeout, indexTableName, am.getZKTable())) {
new DisableTableHandler(master, indexTableName, master.getCatalogTracker(), am,
master.getTableLockManager(), false).process();
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Table " + indexTableName + " not in ENABLED state to disable.");
}
}
}
}
} finally {
// clear user table region plans in secondary index load balancer.
clearRegionPlans((HMaster) master, tableName.getNamespaceAsString());
}
LOG.info("Exiting from postDisableTableHandler of table " + tableName);
}
示例11: disableTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
public void disableTable(final byte [] tableName) throws IOException {
if (cpHost != null) {
cpHost.preDisableTable(tableName);
}
this.executorService.submit(new DisableTableHandler(this, tableName,
catalogTracker, assignmentManager, false));
if (cpHost != null) {
cpHost.postDisableTable(tableName);
}
}
示例12: disableTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
@Override
public void disableTable(final TableName tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDisableTable(tableName);
}
LOG.info(getClientIdAuditPrefix() + " disable " + tableName);
this.service.submit(new DisableTableHandler(this, tableName,
catalogTracker, assignmentManager, tableLockManager, false).prepare());
if (cpHost != null) {
cpHost.postDisableTable(tableName);
}
}
示例13: disableTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
@Override
public void disableTable(final byte[] tableName) throws IOException {
checkInitialized();
if (cpHost != null) {
cpHost.preDisableTable(tableName);
}
this.executorService.submit(new DisableTableHandler(this, tableName,
catalogTracker, assignmentManager, false));
if (cpHost != null) {
cpHost.postDisableTable(tableName);
}
}
示例14: recoverTableInDisablingState
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
/**
* Recover the tables that were not fully moved to DISABLED state. These
* tables are in DISABLING state when the master restarted/switched.
*
* @throws KeeperException
* @throws TableNotFoundException
* @throws IOException
*/
private void recoverTableInDisablingState()
throws KeeperException, TableNotFoundException, IOException {
Set<String> disablingTables = ZKTable.getDisablingTables(watcher);
if (disablingTables.size() != 0) {
for (String tableName : disablingTables) {
// Recover by calling DisableTableHandler
LOG.info("The table " + tableName
+ " is in DISABLING state. Hence recovering by moving the table"
+ " to DISABLED state.");
new DisableTableHandler(this.server, tableName.getBytes(),
catalogTracker, this, true).process();
}
}
}
示例15: createSecondaryIndexTable
import org.apache.hadoop.hbase.master.handler.DisableTableHandler; //导入依赖的package包/类
/**
* @param IndexedHTableDescriptor iDesc
* @param HRegionInfo [] regions
* @param MasterServices master
* @throws NotAllMetaRegionsOnlineException
* @throws IOException
*/
private void createSecondaryIndexTable(IndexedHTableDescriptor iDesc, byte[][] splitKeys,
MasterServices master, boolean disableTable) throws NotAllMetaRegionsOnlineException,
IOException {
String indexTableName = IndexUtils.getIndexTableName(iDesc.getNameAsString());
LOG.info("Creating secondary index table " + indexTableName + " for table "
+ iDesc.getNameAsString() + '.');
HTableDescriptor indexTableDesc = new HTableDescriptor(indexTableName);
HColumnDescriptor columnDescriptor = new HColumnDescriptor(Constants.IDX_COL_FAMILY);
String dataBlockEncodingAlgo =
master.getConfiguration().get("index.data.block.encoding.algo", "NONE");
DataBlockEncoding[] values = DataBlockEncoding.values();
for (DataBlockEncoding dataBlockEncoding : values) {
if (dataBlockEncoding.toString().equals(dataBlockEncodingAlgo)) {
columnDescriptor.setDataBlockEncoding(dataBlockEncoding);
}
}
indexTableDesc.addFamily(columnDescriptor);
indexTableDesc.setValue(HTableDescriptor.SPLIT_POLICY,
ConstantSizeRegionSplitPolicy.class.getName());
indexTableDesc.setMaxFileSize(Long.MAX_VALUE);
LOG.info("Setting the split policy for the Index Table " + indexTableName
+ " as ConstantSizeRegionSplitPolicy with maxFileSize as " + Long.MAX_VALUE + '.');
HRegionInfo[] newRegions = getHRegionInfos(indexTableDesc, splitKeys);
new CreateTableHandler(master, master.getMasterFileSystem(), master.getServerManager(),
indexTableDesc, master.getConfiguration(), newRegions, master.getCatalogTracker(),
master.getAssignmentManager()).process();
// Disable the index table so that when we enable the main table both can be enabled
if (disableTable) {
new DisableTableHandler(master, Bytes.toBytes(indexTableName), master.getCatalogTracker(),
master.getAssignmentManager(), false).process();
}
LOG.info("Created secondary index table " + indexTableName + " for table "
+ iDesc.getNameAsString() + '.');
}