本文整理汇总了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;
}
}
示例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);
}