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


Java HLogSplitter.split方法代码示例

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


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

示例1: doOfflineLogSplitting

import org.apache.hadoop.hbase.regionserver.wal.HLogSplitter; //导入方法依赖的package包/类
/**
 * Performs log splitting for all regionserver directories.
 * @throws Exception
 */
private void doOfflineLogSplitting() throws Exception {
  LOG.info("Starting Log splitting");
  final Path rootDir = FSUtils.getRootDir(getConf());
  final Path oldLogDir = new Path(rootDir, HConstants.HREGION_OLDLOGDIR_NAME);
  FileSystem fs = FSUtils.getCurrentFileSystem(getConf());
  Path logDir = new Path(rootDir, HConstants.HREGION_LOGDIR_NAME);
  FileStatus[] regionServerLogDirs = FSUtils.listStatus(fs, logDir);
  if (regionServerLogDirs == null || regionServerLogDirs.length == 0) {
    LOG.info("No log directories to split, returning");
    return;
  }
  try {
    for (FileStatus regionServerLogDir : regionServerLogDirs) {
      // split its log dir, if exists
      HLogSplitter.split(rootDir, regionServerLogDir.getPath(), oldLogDir, fs, getConf());
    }
    LOG.info("Successfully completed Log splitting");
  } catch (Exception e) {
    LOG.error("Got exception while doing Log splitting ", e);
    throw e;
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:27,代码来源:UpgradeTo96.java

示例2: runWALSplit

import org.apache.hadoop.hbase.regionserver.wal.HLogSplitter; //导入方法依赖的package包/类
private Path runWALSplit(final Configuration c) throws IOException {
  List<Path> splits = HLogSplitter.split(
    hbaseRootDir, logDir, oldLogDir, FileSystem.get(c), c);
  // Split should generate only 1 file since there's only 1 region
  assertEquals(1, splits.size());
  // Make sure the file exists
  assertTrue(fs.exists(splits.get(0)));
  LOG.info("Split file=" + splits.get(0));
  return splits.get(0);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:11,代码来源:TestWALObserver.java


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