当前位置: 首页>>代码示例>>Java>>正文


Java DisableTableHandler类代码示例

本文整理汇总了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();
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:AssignmentManager.java

示例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;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:30,代码来源:AssignmentManager.java

示例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 + '.');
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:20,代码来源:IndexMasterObserver.java

示例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();
    }
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:24,代码来源:AssignmentManager.java

示例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 + '.');
}
 
开发者ID:Huawei-Hadoop,项目名称:hindex,代码行数:21,代码来源:IndexMasterObserver.java

示例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);
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:13,代码来源:HMaster.java

示例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);
    }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:14,代码来源:HMaster.java

示例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);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:14,代码来源:HMaster.java

示例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();
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:23,代码来源:AssignmentManager.java

示例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);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:41,代码来源:IndexMasterObserver.java

示例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);
  }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:12,代码来源:HMaster.java

示例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);
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:14,代码来源:HMaster.java

示例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);
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:13,代码来源:HMaster.java

示例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();
    }
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:23,代码来源:AssignmentManager.java

示例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() + '.');

}
 
开发者ID:Huawei-Hadoop,项目名称:hindex,代码行数:45,代码来源:IndexMasterObserver.java


注:本文中的org.apache.hadoop.hbase.master.handler.DisableTableHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。