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


Java ModifyRegionUtils.createRegions方法代码示例

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


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

示例1: handleCreateHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Create the on-disk structure for the table, and returns the regions info.
 * @param tableRootDir directory where the table is being created
 * @param tableName name of the table under construction
 * @return the list of regions created
 */
protected List<HRegionInfo> handleCreateHdfsRegions(final Path tableRootDir,
  final TableName tableName)
    throws IOException {
  return ModifyRegionUtils.createRegions(conf, tableRootDir,
      hTableDescriptor, newRegions, null);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:CreateTableHandler.java

示例2: cloneHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Clone specified regions. For each region create a new region
 * and create a HFileLink for each hfile.
 */
private HRegionInfo[] cloneHdfsRegions(final ThreadPoolExecutor exec,
    final Map<String, SnapshotRegionManifest> regionManifests,
    final List<HRegionInfo> regions) throws IOException {
  if (regions == null || regions.size() == 0) return null;

  final Map<String, HRegionInfo> snapshotRegions =
    new HashMap<String, HRegionInfo>(regions.size());

  // clone region info (change embedded tableName with the new one)
  HRegionInfo[] clonedRegionsInfo = new HRegionInfo[regions.size()];
  for (int i = 0; i < clonedRegionsInfo.length; ++i) {
    // clone the region info from the snapshot region info
    HRegionInfo snapshotRegionInfo = regions.get(i);
    clonedRegionsInfo[i] = cloneRegionInfo(snapshotRegionInfo);

    // add the region name mapping between snapshot and cloned
    String snapshotRegionName = snapshotRegionInfo.getEncodedName();
    String clonedRegionName = clonedRegionsInfo[i].getEncodedName();
    regionsMap.put(Bytes.toBytes(snapshotRegionName), Bytes.toBytes(clonedRegionName));
    LOG.info("clone region=" + snapshotRegionName + " as " + clonedRegionName);

    // Add mapping between cloned region name and snapshot region info
    snapshotRegions.put(clonedRegionName, snapshotRegionInfo);
  }

  // create the regions on disk
  ModifyRegionUtils.createRegions(exec, conf, rootDir, tableDir,
    tableDesc, clonedRegionsInfo, new ModifyRegionUtils.RegionFillTask() {
      @Override
      public void fillRegion(final HRegion region) throws IOException {
        HRegionInfo snapshotHri = snapshotRegions.get(region.getRegionInfo().getEncodedName());
        cloneRegion(region, snapshotHri, regionManifests.get(snapshotHri.getEncodedName()));
      }
    });

  return clonedRegionsInfo;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:42,代码来源:RestoreSnapshotHelper.java

示例3: handleCreateHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Create the on-disk structure for the table, and returns the regions info.
 * @param tableRootDir directory where the table is being created
 * @param tableName name of the table under construction
 * @return the list of regions created
 */
protected List<HRegionInfo> handleCreateHdfsRegions(final Path tableRootDir,
  final String tableName)
    throws IOException {
  return ModifyRegionUtils.createRegions(conf, tableRootDir,
      hTableDescriptor, newRegions, null);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:13,代码来源:CreateTableHandler.java

示例4: cloneHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Clone specified regions. For each region create a new region
 * and create a HFileLink for each hfile.
 */
private HRegionInfo[] cloneHdfsRegions(final List<HRegionInfo> regions) throws IOException {
  if (regions == null || regions.size() == 0) return null;

  final Map<String, HRegionInfo> snapshotRegions =
    new HashMap<String, HRegionInfo>(regions.size());

  // clone region info (change embedded tableName with the new one)
  HRegionInfo[] clonedRegionsInfo = new HRegionInfo[regions.size()];
  for (int i = 0; i < clonedRegionsInfo.length; ++i) {
    // clone the region info from the snapshot region info
    HRegionInfo snapshotRegionInfo = regions.get(i);
    clonedRegionsInfo[i] = cloneRegionInfo(snapshotRegionInfo);

    // add the region name mapping between snapshot and cloned
    String snapshotRegionName = snapshotRegionInfo.getEncodedName();
    String clonedRegionName = clonedRegionsInfo[i].getEncodedName();
    regionsMap.put(Bytes.toBytes(snapshotRegionName), Bytes.toBytes(clonedRegionName));
    LOG.info("clone region=" + snapshotRegionName + " as " + clonedRegionName);

    // Add mapping between cloned region name and snapshot region info
    snapshotRegions.put(clonedRegionName, snapshotRegionInfo);
  }

  // create the regions on disk
  ModifyRegionUtils.createRegions(conf, tableDir.getParent(),
    tableDesc, clonedRegionsInfo, new ModifyRegionUtils.RegionFillTask() {
      public void fillRegion(final HRegion region) throws IOException {
        cloneRegion(region, snapshotRegions.get(region.getRegionInfo().getEncodedName()));
      }
    });

  return clonedRegionsInfo;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:38,代码来源:RestoreSnapshotHelper.java

示例5: cloneHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Clone specified regions. For each region create a new region
 * and create a HFileLink for each hfile.
 */
private HRegionInfo[] cloneHdfsRegions(final List<HRegionInfo> regions) throws IOException {
  if (regions == null || regions.size() == 0) return null;

  final Map<String, HRegionInfo> snapshotRegions =
    new HashMap<String, HRegionInfo>(regions.size());

  // clone region info (change embedded tableName with the new one)
  HRegionInfo[] clonedRegionsInfo = new HRegionInfo[regions.size()];
  for (int i = 0; i < clonedRegionsInfo.length; ++i) {
    // clone the region info from the snapshot region info
    HRegionInfo snapshotRegionInfo = regions.get(i);
    clonedRegionsInfo[i] = cloneRegionInfo(snapshotRegionInfo);

    // add the region name mapping between snapshot and cloned
    String snapshotRegionName = snapshotRegionInfo.getEncodedName();
    String clonedRegionName = clonedRegionsInfo[i].getEncodedName();
    regionsMap.put(Bytes.toBytes(snapshotRegionName), Bytes.toBytes(clonedRegionName));
    LOG.info("clone region=" + snapshotRegionName + " as " + clonedRegionName);

    // Add mapping between cloned region name and snapshot region info
    snapshotRegions.put(clonedRegionName, snapshotRegionInfo);
  }

  // create the regions on disk
  ModifyRegionUtils.createRegions(conf, rootDir, tableDir,
    tableDesc, clonedRegionsInfo, new ModifyRegionUtils.RegionFillTask() {
      @Override
      public void fillRegion(final HRegion region) throws IOException {
        cloneRegion(region, snapshotRegions.get(region.getRegionInfo().getEncodedName()));
      }
    });

  return clonedRegionsInfo;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:39,代码来源:RestoreSnapshotHelper.java

示例6: cloneHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Clone specified regions. For each region create a new region
 * and create a HFileLink for each hfile.
 */
private RegionInfo[] cloneHdfsRegions(final ThreadPoolExecutor exec,
    final Map<String, SnapshotRegionManifest> regionManifests,
    final List<RegionInfo> regions) throws IOException {
  if (regions == null || regions.isEmpty()) return null;

  final Map<String, RegionInfo> snapshotRegions = new HashMap<>(regions.size());

  // clone region info (change embedded tableName with the new one)
  RegionInfo[] clonedRegionsInfo = new RegionInfo[regions.size()];
  for (int i = 0; i < clonedRegionsInfo.length; ++i) {
    // clone the region info from the snapshot region info
    RegionInfo snapshotRegionInfo = regions.get(i);
    clonedRegionsInfo[i] = cloneRegionInfo(snapshotRegionInfo);

    // add the region name mapping between snapshot and cloned
    String snapshotRegionName = snapshotRegionInfo.getEncodedName();
    String clonedRegionName = clonedRegionsInfo[i].getEncodedName();
    regionsMap.put(Bytes.toBytes(snapshotRegionName), Bytes.toBytes(clonedRegionName));
    LOG.info("clone region=" + snapshotRegionName + " as " + clonedRegionName);

    // Add mapping between cloned region name and snapshot region info
    snapshotRegions.put(clonedRegionName, snapshotRegionInfo);
  }

  // create the regions on disk
  ModifyRegionUtils.createRegions(exec, conf, rootDir,
    tableDesc, clonedRegionsInfo, new ModifyRegionUtils.RegionFillTask() {
      @Override
      public void fillRegion(final HRegion region) throws IOException {
        RegionInfo snapshotHri = snapshotRegions.get(region.getRegionInfo().getEncodedName());
        cloneRegion(region, snapshotHri, regionManifests.get(snapshotHri.getEncodedName()));
      }
    });

  return clonedRegionsInfo;
}
 
开发者ID:apache,项目名称:hbase,代码行数:41,代码来源:RestoreSnapshotHelper.java

示例7: cloneHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Clone specified regions. For each region create a new region
 * and create a HFileLink for each hfile.
 */
private HRegionInfo[] cloneHdfsRegions(final List<HRegionInfo> regions) throws IOException {
  if (regions == null || regions.size() == 0) return null;

  final Map<String, HRegionInfo> snapshotRegions =
    new HashMap<String, HRegionInfo>(regions.size());

  // clone region info (change embedded tableName with the new one)
  HRegionInfo[] clonedRegionsInfo = new HRegionInfo[regions.size()];
  for (int i = 0; i < clonedRegionsInfo.length; ++i) {
    // clone the region info from the snapshot region info
    HRegionInfo snapshotRegionInfo = regions.get(i);
    clonedRegionsInfo[i] = cloneRegionInfo(snapshotRegionInfo);

    // add the region name mapping between snapshot and cloned
    String snapshotRegionName = snapshotRegionInfo.getEncodedName();
    String clonedRegionName = clonedRegionsInfo[i].getEncodedName();
    regionsMap.put(Bytes.toBytes(snapshotRegionName), Bytes.toBytes(clonedRegionName));
    LOG.info("clone region=" + snapshotRegionName + " as " + clonedRegionName);

    // Add mapping between cloned region name and snapshot region info
    snapshotRegions.put(clonedRegionName, snapshotRegionInfo);
  }

  // create the regions on disk
  ModifyRegionUtils.createRegions(conf, rootDir,
    tableDesc, clonedRegionsInfo, new ModifyRegionUtils.RegionFillTask() {
      public void fillRegion(final HRegion region) throws IOException {
        cloneRegion(region, snapshotRegions.get(region.getRegionInfo().getEncodedName()));
      }
    });

  return clonedRegionsInfo;
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:38,代码来源:RestoreSnapshotHelper.java


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