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


Java MetaEditor.deleteRegion方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.catalog.MetaEditor.deleteRegion方法的典型用法代码示例。如果您正苦于以下问题:Java MetaEditor.deleteRegion方法的具体用法?Java MetaEditor.deleteRegion怎么用?Java MetaEditor.deleteRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.catalog.MetaEditor的用法示例。


在下文中一共展示了MetaEditor.deleteRegion方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanParent

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
/**
 * If daughters no longer hold reference to the parents, delete the parent.
 * @param server HRegionInterface of meta server to talk to
 * @param parent HRegionInfo of split offlined parent
 * @param rowContent Content of <code>parent</code> row in
 * <code>metaRegionName</code>
 * @return True if we removed <code>parent</code> from meta table and from
 * the filesystem.
 * @throws IOException
 */
boolean cleanParent(final HRegionInfo parent, Result rowContent)
throws IOException {
  boolean result = false;
  // Run checks on each daughter split.
  HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER);
  HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER);
  Pair<Boolean, Boolean> a =
    checkDaughterInFs(parent, a_region, HConstants.SPLITA_QUALIFIER);
  Pair<Boolean, Boolean> b =
    checkDaughterInFs(parent, b_region, HConstants.SPLITB_QUALIFIER);
  if (hasNoReferences(a) && hasNoReferences(b)) {
    LOG.debug("Deleting region " + parent.getRegionNameAsString() +
      " because daughter splits no longer hold references");

    // This latter regionOffline should not be necessary but is done for now
    // until we let go of regionserver to master heartbeats.  See HBASE-3368.
    if (this.services.getAssignmentManager() != null) {
      // The mock used in testing catalogjanitor returns null for getAssignmnetManager.
      // Allow for null result out of getAssignmentManager.
      this.services.getAssignmentManager().regionOffline(parent);
    }
    FileSystem fs = this.services.getMasterFileSystem().getFileSystem();
    HFileArchiver.archiveRegion(this.services.getConfiguration(), fs, parent);
    MetaEditor.deleteRegion(this.server.getCatalogTracker(), parent);
    result = true;
  }
  return result;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:39,代码来源:CatalogJanitor.java

示例2: cleanParent

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
/**
 * If daughters no longer hold reference to the parents, delete the parent.
 * @param parent HRegionInfo of split offlined parent
 * @param rowContent Content of <code>parent</code> row in
 * <code>metaRegionName</code>
 * @return True if we removed <code>parent</code> from meta table and from
 * the filesystem.
 * @throws IOException
 */
boolean cleanParent(final HRegionInfo parent, Result rowContent)
throws IOException {
  boolean result = false;
  // Check whether it is a merged region and not clean reference
  // No necessary to check MERGEB_QUALIFIER because these two qualifiers will
  // be inserted/deleted together
  if (rowContent.getValue(HConstants.CATALOG_FAMILY,
      HConstants.MERGEA_QUALIFIER) != null) {
    // wait cleaning merge region first
    return result;
  }
  // Run checks on each daughter split.
  PairOfSameType<HRegionInfo> daughters = HRegionInfo.getDaughterRegions(rowContent);
  Pair<Boolean, Boolean> a = checkDaughterInFs(parent, daughters.getFirst());
  Pair<Boolean, Boolean> b = checkDaughterInFs(parent, daughters.getSecond());
  if (hasNoReferences(a) && hasNoReferences(b)) {
    LOG.debug("Deleting region " + parent.getRegionNameAsString() +
      " because daughter splits no longer hold references");
    FileSystem fs = this.services.getMasterFileSystem().getFileSystem();
    if (LOG.isTraceEnabled()) LOG.trace("Archiving parent region: " + parent);
    HFileArchiver.archiveRegion(this.services.getConfiguration(), fs, parent);
    MetaEditor.deleteRegion(this.server.getCatalogTracker(), parent);
    result = true;
  }
  return result;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:36,代码来源:CatalogJanitor.java

示例3: cleanParent

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
/**
 * If daughters no longer hold reference to the parents, delete the parent.
 * @param server HRegionInterface of meta server to talk to 
 * @param parent HRegionInfo of split offlined parent
 * @param rowContent Content of <code>parent</code> row in
 * <code>metaRegionName</code>
 * @return True if we removed <code>parent</code> from meta table and from
 * the filesystem.
 * @throws IOException
 */
boolean cleanParent(final HRegionInfo parent, Result rowContent)
throws IOException {
  boolean result = false;
  // Run checks on each daughter split.
  HRegionInfo a_region = getDaughterRegionInfo(rowContent, HConstants.SPLITA_QUALIFIER);
  HRegionInfo b_region = getDaughterRegionInfo(rowContent, HConstants.SPLITB_QUALIFIER);
  Pair<Boolean, Boolean> a =
    checkDaughterInFs(parent, a_region, HConstants.SPLITA_QUALIFIER);
  Pair<Boolean, Boolean> b =
    checkDaughterInFs(parent, b_region, HConstants.SPLITB_QUALIFIER);
  if (hasNoReferences(a) && hasNoReferences(b)) {
    LOG.debug("Deleting region " + parent.getRegionNameAsString() +
      " because daughter splits no longer hold references");
 // wipe out daughter references from parent region
    removeDaughtersFromParent(parent);

    // This latter regionOffline should not be necessary but is done for now
    // until we let go of regionserver to master heartbeats.  See HBASE-3368.
    if (this.services.getAssignmentManager() != null) {
      // The mock used in testing catalogjanitor returns null for getAssignmnetManager.
      // Allow for null result out of getAssignmentManager.
      this.services.getAssignmentManager().regionOffline(parent);
    }
    FileSystem fs = this.services.getMasterFileSystem().getFileSystem();
    Path rootdir = this.services.getMasterFileSystem().getRootDir();
    HRegion.deleteRegion(fs, rootdir, parent);
    MetaEditor.deleteRegion(this.server.getCatalogTracker(), parent);
    result = true;
  }
  return result;
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:42,代码来源:CatalogJanitor.java

示例4: handleTableOperation

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
@Override
protected void handleTableOperation(List<HRegionInfo> regions)
throws IOException, KeeperException {
  AssignmentManager am = this.masterServices.getAssignmentManager();
  long waitTime = server.getConfiguration().
    getLong("hbase.master.wait.on.region", 5 * 60 * 1000);
  for (HRegionInfo region : regions) {
    long done = System.currentTimeMillis() + waitTime;
    while (System.currentTimeMillis() < done) {
      AssignmentManager.RegionState rs = am.isRegionInTransition(region);
      if (rs == null) break;
      Threads.sleep(waitingTimeForEvents);
      LOG.debug("Waiting on  region to clear regions in transition; " + rs);
    }
    if (am.isRegionInTransition(region) != null) {
      throw new IOException("Waited hbase.master.wait.on.region (" +
        waitTime + "ms) for region to leave region " +
        region.getRegionNameAsString() + " in transitions");
    }
    LOG.debug("Deleting region " + region.getRegionNameAsString() +
      " from META and FS");
    // Remove region from META
    MetaEditor.deleteRegion(this.server.getCatalogTracker(), region);
    // Delete region from FS
    this.masterServices.getMasterFileSystem().deleteRegion(region);
  }
  // Delete table from FS
  this.masterServices.getMasterFileSystem().deleteTable(tableName);
  // Update table descriptor cache
  this.masterServices.getTableDescriptors().remove(Bytes.toString(tableName));

  // If entry for this table in zk, and up in AssignmentManager, remove it.
  // Call to undisableTable does this. TODO: Make a more formal purge table.
  am.getZKTable().setEnabledTable(Bytes.toString(tableName));
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:36,代码来源:DeleteTableHandler.java

示例5: cleanParent

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
/**
 * If daughters no longer hold reference to the parents, delete the parent.
 * @param parent HRegionInfo of split offlined parent
 * @param rowContent Content of <code>parent</code> row in
 * <code>metaRegionName</code>
 * @return True if we removed <code>parent</code> from meta table and from
 * the filesystem.
 * @throws IOException
 */
boolean cleanParent(final HRegionInfo parent, Result rowContent)
throws IOException {
  boolean result = false;
  // Run checks on each daughter split.
  PairOfSameType<HRegionInfo> daughters = HRegionInfo.getDaughterRegions(rowContent);
  Pair<Boolean, Boolean> a =
    checkDaughterInFs(parent, daughters.getFirst());
  Pair<Boolean, Boolean> b =
    checkDaughterInFs(parent, daughters.getSecond());
  if (hasNoReferences(a) && hasNoReferences(b)) {
    LOG.debug("Deleting region " + parent.getRegionNameAsString() +
      " because daughter splits no longer hold references");
    // wipe out daughter references from parent region in meta
    removeDaughtersFromParent(parent);

    // This latter regionOffline should not be necessary but is done for now
    // until we let go of regionserver to master heartbeats.  See HBASE-3368.
    if (this.services.getAssignmentManager() != null) {
      // The mock used in testing catalogjanitor returns null for getAssignmnetManager.
      // Allow for null result out of getAssignmentManager.
      this.services.getAssignmentManager().regionOffline(parent);
    }
    FileSystem fs = this.services.getMasterFileSystem().getFileSystem();
    LOG.debug("Archiving parent region:" + parent);
    HFileArchiver.archiveRegion(this.services.getConfiguration(), fs, parent);
    MetaEditor.deleteRegion(this.server.getCatalogTracker(), parent);
    result = true;
  }
  return result;
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:40,代码来源:CatalogJanitor.java

示例6: handleTableOperation

import org.apache.hadoop.hbase.catalog.MetaEditor; //导入方法依赖的package包/类
@Override
protected void handleTableOperation(List<HRegionInfo> regions)
throws IOException, KeeperException {
  MasterCoprocessorHost cpHost = ((HMaster) this.server)
      .getCoprocessorHost();
  if (cpHost != null) {
    cpHost.preDeleteTableHandler(this.tableName);
  }
  AssignmentManager am = this.masterServices.getAssignmentManager();
  long waitTime = server.getConfiguration().
    getLong("hbase.master.wait.on.region", 5 * 60 * 1000);
  for (HRegionInfo region : regions) {
    long done = System.currentTimeMillis() + waitTime;
    while (System.currentTimeMillis() < done) {
      if (!am.getRegionStates().isRegionInTransition(region)) break;
      Threads.sleep(waitingTimeForEvents);
      LOG.debug("Waiting on region to clear regions in transition; "
        + am.getRegionStates().getRegionTransitionState(region));
    }
    if (am.getRegionStates().isRegionInTransition(region)) {
      throw new IOException("Waited hbase.master.wait.on.region (" +
        waitTime + "ms) for region to leave region " +
        region.getRegionNameAsString() + " in transitions");
    }
    LOG.debug("Deleting region " + region.getRegionNameAsString() +
      " from META and FS");
    // Remove region from META
    MetaEditor.deleteRegion(this.server.getCatalogTracker(), region);
    // Delete region from FS
    this.masterServices.getMasterFileSystem().deleteRegion(region);
  }
  // Delete table from FS
  this.masterServices.getMasterFileSystem().deleteTable(tableName);
  // Update table descriptor cache
  this.masterServices.getTableDescriptors().remove(Bytes.toString(tableName));

  // If entry for this table in zk, and up in AssignmentManager, remove it.

  am.getZKTable().setDeletedTable(Bytes.toString(tableName));
  if (cpHost != null) {
    cpHost.postDeleteTableHandler(this.tableName);
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:44,代码来源:DeleteTableHandler.java


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