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


Java ModifyRegionUtils.editRegions方法代码示例

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


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

示例1: removeHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Remove specified regions from the file-system, using the archiver.
 */
private void removeHdfsRegions(final ThreadPoolExecutor exec, final List<HRegionInfo> regions)
    throws IOException {
  if (regions == null || regions.size() == 0) return;
  ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
    @Override
    public void editRegion(final HRegionInfo hri) throws IOException {
      HFileArchiver.archiveRegion(conf, fs, hri);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:RestoreSnapshotHelper.java

示例2: restoreHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Restore specified regions by restoring content to the snapshot state.
 */
private void restoreHdfsRegions(final ThreadPoolExecutor exec,
    final Map<String, SnapshotRegionManifest> regionManifests,
    final List<HRegionInfo> regions) throws IOException {
  if (regions == null || regions.size() == 0) return;
  ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
    @Override
    public void editRegion(final HRegionInfo hri) throws IOException {
      restoreRegion(hri, regionManifests.get(hri.getEncodedName()));
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:RestoreSnapshotHelper.java

示例3: removeHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Remove specified regions from the file-system, using the archiver.
 */
private void removeHdfsRegions(final ThreadPoolExecutor exec, final List<RegionInfo> regions)
    throws IOException {
  if (regions == null || regions.isEmpty()) return;
  ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
    @Override
    public void editRegion(final RegionInfo hri) throws IOException {
      HFileArchiver.archiveRegion(conf, fs, hri);
    }
  });
}
 
开发者ID:apache,项目名称:hbase,代码行数:14,代码来源:RestoreSnapshotHelper.java

示例4: restoreHdfsRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Restore specified regions by restoring content to the snapshot state.
 */
private void restoreHdfsRegions(final ThreadPoolExecutor exec,
    final Map<String, SnapshotRegionManifest> regionManifests,
    final List<RegionInfo> regions) throws IOException {
  if (regions == null || regions.isEmpty()) return;
  ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
    @Override
    public void editRegion(final RegionInfo hri) throws IOException {
      restoreRegion(hri, regionManifests.get(hri.getEncodedName()));
    }
  });
}
 
开发者ID:apache,项目名称:hbase,代码行数:15,代码来源:RestoreSnapshotHelper.java

示例5: restoreHdfsMobRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
/**
 * Restore specified mob regions by restoring content to the snapshot state.
 */
private void restoreHdfsMobRegions(final ThreadPoolExecutor exec,
    final Map<String, SnapshotRegionManifest> regionManifests,
    final List<RegionInfo> regions) throws IOException {
  if (regions == null || regions.isEmpty()) return;
  ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
    @Override
    public void editRegion(final RegionInfo hri) throws IOException {
      restoreMobRegion(hri, regionManifests.get(hri.getEncodedName()));
    }
  });
}
 
开发者ID:apache,项目名称:hbase,代码行数:15,代码来源:RestoreSnapshotHelper.java

示例6: snapshotRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
@Override
public void snapshotRegions(List<Pair<HRegionInfo, ServerName>> regionsAndLocations)
    throws IOException, KeeperException {
  try {
    // 1. get all the regions hosting this table.

    // extract each pair to separate lists
    Set<HRegionInfo> regions = new HashSet<HRegionInfo>();
    for (Pair<HRegionInfo, ServerName> p : regionsAndLocations) {
      // Don't include non-default regions
      HRegionInfo hri = p.getFirst();
      if (RegionReplicaUtil.isDefaultReplica(hri)) {
        regions.add(hri);
      }
    }

    // 2. for each region, write all the info to disk
    String msg = "Starting to write region info and WALs for regions for offline snapshot:"
        + ClientSnapshotDescriptionUtils.toString(snapshot);
    LOG.info(msg);
    status.setStatus(msg);

    ThreadPoolExecutor exec = SnapshotManifest.createExecutor(conf, "DisabledTableSnapshot");
    try {
      ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
        @Override
        public void editRegion(final HRegionInfo regionInfo) throws IOException {
          snapshotManifest.addRegion(FSUtils.getTableDir(rootDir, snapshotTable), regionInfo);
        }
      });
    } finally {
      exec.shutdown();
    }
  } catch (Exception e) {
    // make sure we capture the exception to propagate back to the client later
    String reason = "Failed snapshot " + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " due to exception:" + e.getMessage();
    ForeignException ee = new ForeignException(reason, e);
    monitor.receive(ee);
    status.abort("Snapshot of table: "+ snapshotTable + " failed because " + e.getMessage());
  } finally {
    LOG.debug("Marking snapshot" + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " as finished.");
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:46,代码来源:DisabledTableSnapshotHandler.java

示例7: snapshotRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
@Override
public void snapshotRegions(List<Pair<HRegionInfo, ServerName>> regionsAndLocations)
    throws IOException, KeeperException {
  try {
    timeoutInjector.start();

    // 1. get all the regions hosting this table.

    // extract each pair to separate lists
    Set<HRegionInfo> regions = new HashSet<HRegionInfo>();
    for (Pair<HRegionInfo, ServerName> p : regionsAndLocations) {
      // Don't include non-default regions
      HRegionInfo hri = p.getFirst();
      if (RegionReplicaUtil.isDefaultReplica(hri)) {
        regions.add(hri);
      }
    }

    // 2. for each region, write all the info to disk
    String msg = "Starting to write region info and WALs for regions for offline snapshot:"
        + ClientSnapshotDescriptionUtils.toString(snapshot);
    LOG.info(msg);
    status.setStatus(msg);

    ThreadPoolExecutor exec = SnapshotManifest.createExecutor(conf, "DisabledTableSnapshot");
    try {
      ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
        @Override
        public void editRegion(final HRegionInfo regionInfo) throws IOException {
          snapshotManifest.addRegion(FSUtils.getTableDir(rootDir, snapshotTable), regionInfo);
        }
      });
    } finally {
      exec.shutdown();
    }
  } catch (Exception e) {
    // make sure we capture the exception to propagate back to the client later
    String reason = "Failed snapshot " + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " due to exception:" + e.getMessage();
    ForeignException ee = new ForeignException(reason, e);
    monitor.receive(ee);
    status.abort("Snapshot of table: "+ snapshotTable + " failed because " + e.getMessage());
  } finally {
    LOG.debug("Marking snapshot" + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " as finished.");

    // 3. mark the timer as finished - even if we got an exception, we don't need to time the
    // operation any further
    timeoutInjector.complete();
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:52,代码来源:DisabledTableSnapshotHandler.java

示例8: snapshotRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
@Override
public void snapshotRegions(List<Pair<RegionInfo, ServerName>> regionsAndLocations)
    throws IOException, KeeperException {
  try {
    // 1. get all the regions hosting this table.

    // extract each pair to separate lists
    Set<RegionInfo> regions = new HashSet<>();
    for (Pair<RegionInfo, ServerName> p : regionsAndLocations) {
      // Don't include non-default regions
      RegionInfo hri = p.getFirst();
      if (RegionReplicaUtil.isDefaultReplica(hri)) {
        regions.add(hri);
      }
    }
    // handle the mob files if any.
    boolean mobEnabled = MobUtils.hasMobColumns(htd);
    if (mobEnabled) {
      // snapshot the mob files as a offline region.
      RegionInfo mobRegionInfo = MobUtils.getMobRegionInfo(htd.getTableName());
      regions.add(mobRegionInfo);
    }

    // 2. for each region, write all the info to disk
    String msg = "Starting to write region info and WALs for regions for offline snapshot:"
        + ClientSnapshotDescriptionUtils.toString(snapshot);
    LOG.info(msg);
    status.setStatus(msg);

    ThreadPoolExecutor exec = SnapshotManifest.createExecutor(conf, "DisabledTableSnapshot");
    try {
      ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
        @Override
        public void editRegion(final RegionInfo regionInfo) throws IOException {
          snapshotManifest.addRegion(FSUtils.getTableDir(rootDir, snapshotTable), regionInfo);
        }
      });
    } finally {
      exec.shutdown();
    }
  } catch (Exception e) {
    // make sure we capture the exception to propagate back to the client later
    String reason = "Failed snapshot " + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " due to exception:" + e.getMessage();
    ForeignException ee = new ForeignException(reason, e);
    monitor.receive(ee);
    status.abort("Snapshot of table: "+ snapshotTable + " failed because " + e.getMessage());
  } finally {
    LOG.debug("Marking snapshot" + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " as finished.");
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:53,代码来源:DisabledTableSnapshotHandler.java

示例9: snapshotRegions

import org.apache.hadoop.hbase.util.ModifyRegionUtils; //导入方法依赖的package包/类
@Override
public void snapshotRegions(List<Pair<HRegionInfo, ServerName>> regionsAndLocations)
    throws IOException, KeeperException {
  try {
    timeoutInjector.start();

    // 1. get all the regions hosting this table.

    // extract each pair to separate lists
    Set<HRegionInfo> regions = new HashSet<HRegionInfo>();
    for (Pair<HRegionInfo, ServerName> p : regionsAndLocations) {
      regions.add(p.getFirst());
    }

    // 2. for each region, write all the info to disk
    String msg = "Starting to write region info and WALs for regions for offline snapshot:"
        + ClientSnapshotDescriptionUtils.toString(snapshot);
    LOG.info(msg);
    status.setStatus(msg);

    ThreadPoolExecutor exec = SnapshotManifest.createExecutor(conf, "DisabledTableSnapshot");
    try {
      ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
        @Override
        public void editRegion(final HRegionInfo regionInfo) throws IOException {
          snapshotManifest.addRegion(FSUtils.getTableDir(rootDir, snapshotTable), regionInfo);
        }
      });
    } finally {
      exec.shutdown();
    }
  } catch (Exception e) {
    // make sure we capture the exception to propagate back to the client later
    String reason = "Failed snapshot " + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " due to exception:" + e.getMessage();
    ForeignException ee = new ForeignException(reason, e);
    monitor.receive(ee);
    status.abort("Snapshot of table: "+ snapshotTable + " failed because " + e.getMessage());
  } finally {
    LOG.debug("Marking snapshot" + ClientSnapshotDescriptionUtils.toString(snapshot)
        + " as finished.");

    // 3. mark the timer as finished - even if we got an exception, we don't need to time the
    // operation any further
    timeoutInjector.complete();
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:48,代码来源:DisabledTableSnapshotHandler.java


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