org.apache.hadoop.hbase.zookeeper.ZKSplitLog.getSplitLogDir()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(69)

本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKSplitLog.getSplitLogDir()方法的一些代码示例,展示了ZKSplitLog.getSplitLogDir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKSplitLog.getSplitLogDir()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKSplitLog
类名称:ZKSplitLog
方法名:getSplitLogDir

ZKSplitLog.getSplitLogDir介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

public static boolean isCorrupted(Path rootdir, String logFileName,
   FileSystem fs) throws IOException {
  Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
  boolean isCorrupt;
  isCorrupt = fs.exists(file);
  return isCorrupt;
 }
}

代码示例来源:origin: apache/hbase

public static void markCorrupted(Path rootdir, String logFileName,
  FileSystem fs) {
 Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
 try {
  fs.createNewFile(file);
 } catch (IOException e) {
  LOG.warn("Could not flag a log file as corrupted. Failed to create " +
    file, e);
 }
}

代码示例来源:origin: apache/hbase

private static void finishSplitLogFile(Path walDir, Path oldLogDir,
  Path logPath, Configuration conf) throws IOException {
 List<Path> processedLogs = new ArrayList<>();
 List<Path> corruptedLogs = new ArrayList<>();
 FileSystem walFS = walDir.getFileSystem(conf);
 if (ZKSplitLog.isCorrupted(walDir, logPath.getName(), walFS)) {
  corruptedLogs.add(logPath);
 } else {
  processedLogs.add(logPath);
 }
 archiveLogs(corruptedLogs, processedLogs, oldLogDir, walFS, conf);
 Path stagingDir = ZKSplitLog.getSplitLogDir(walDir, logPath.getName());
 walFS.delete(stagingDir, true);
}

代码示例来源:origin: apache/hbase

WALSplitter s = new WALSplitter(wals, conf, rootdir, fs, null, null);
s.splitLogFile(listStatus[0], null);
Path file = new Path(ZKSplitLog.getSplitLogDir(rootdir, listStatus[0].getPath().getName()),
 "corrupt");
assertTrue(fs.exists(file));

代码示例来源:origin: apache/hbase

WALSplitter s = new WALSplitter(wals, conf, rootdir, fs, null, null);
s.splitLogFile(listStatus[0], null);
Path file = new Path(ZKSplitLog.getSplitLogDir(rootdir, listStatus[0].getPath().getName()),
 "corrupt");
assertTrue(!fs.exists(file));

代码示例来源:origin: org.apache.hbase/hbase-zookeeper

public static boolean isCorrupted(Path rootdir, String logFileName,
   FileSystem fs) throws IOException {
  Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
  boolean isCorrupt;
  isCorrupt = fs.exists(file);
  return isCorrupt;
 }
}

代码示例来源:origin: co.cask.hbase/hbase

public static boolean isCorrupted(Path rootdir, String logFileName,
  FileSystem fs) throws IOException {
 Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
 boolean isCorrupt;
 isCorrupt = fs.exists(file);
 return isCorrupt;
}

代码示例来源:origin: harbby/presto-connectors

public static boolean isCorrupted(Path rootdir, String logFileName,
  FileSystem fs) throws IOException {
 Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
 boolean isCorrupt;
 isCorrupt = fs.exists(file);
 return isCorrupt;
}

代码示例来源:origin: co.cask.hbase/hbase

public static void markCorrupted(Path rootdir, String logFileName,
  FileSystem fs) {
 Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
 try {
  fs.createNewFile(file);
 } catch (IOException e) {
  LOG.warn("Could not flag a log file as corrupted. Failed to create " +
    file, e);
 }
}

代码示例来源:origin: org.apache.hbase/hbase-zookeeper

public static void markCorrupted(Path rootdir, String logFileName,
  FileSystem fs) {
 Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
 try {
  fs.createNewFile(file);
 } catch (IOException e) {
  LOG.warn("Could not flag a log file as corrupted. Failed to create " +
    file, e);
 }
}

代码示例来源:origin: co.cask.hbase/hbase

public static void finishSplitLogFile(Path rootdir, Path oldLogDir,
  String logfile, Configuration conf) throws IOException {
 List<Path> processedLogs = new ArrayList<Path>();
 List<Path> corruptedLogs = new ArrayList<Path>();
 FileSystem fs;
 fs = rootdir.getFileSystem(conf);
 Path logPath = new Path(logfile);
 if (ZKSplitLog.isCorrupted(rootdir, logPath.getName(), fs)) {
  corruptedLogs.add(logPath);
 } else {
  processedLogs.add(logPath);
 }
 archiveLogs(null, corruptedLogs, processedLogs, oldLogDir, fs, conf);
 Path stagingDir = ZKSplitLog.getSplitLogDir(rootdir, logPath.getName());
 fs.delete(stagingDir, true);
}

代码示例来源:origin: harbby/presto-connectors

static void finishSplitLogFile(Path rootdir, Path oldLogDir,
  Path logPath, Configuration conf) throws IOException {
 List<Path> processedLogs = new ArrayList<Path>();
 List<Path> corruptedLogs = new ArrayList<Path>();
 FileSystem fs;
 fs = rootdir.getFileSystem(conf);
 if (ZKSplitLog.isCorrupted(rootdir, logPath.getName(), fs)) {
  corruptedLogs.add(logPath);
 } else {
  processedLogs.add(logPath);
 }
 archiveLogs(corruptedLogs, processedLogs, oldLogDir, fs, conf);
 Path stagingDir = ZKSplitLog.getSplitLogDir(rootdir, logPath.getName());
 fs.delete(stagingDir, true);
}

代码示例来源:origin: harbby/presto-connectors

public static void markCorrupted(Path rootdir, String logFileName,
  FileSystem fs) {
 Path file = new Path(getSplitLogDir(rootdir, logFileName), "corrupt");
 try {
  fs.createNewFile(file);
 } catch (IOException e) {
  LOG.warn("Could not flag a log file as corrupted. Failed to create " +
    file, e);
 }
}

代码示例来源:origin: co.cask.hbase/hbase

Path convertRegionEditsToTemp(Path rootdir, Path edits, String tmpname) {
 List<String> components = new ArrayList<String>(10);
 do {
  components.add(edits.getName());
  edits = edits.getParent();
 } while (edits.depth() > rootdir.depth());
 Path ret = ZKSplitLog.getSplitLogDir(rootdir, tmpname);
 for (int i = components.size() - 1; i >= 0; i--) {
  ret = new Path(ret, components.get(i));
 }
 try {
  if (fs.exists(ret)) {
   LOG.warn("Found existing old temporary edits file. It could be the "
     + "result of a previous failed split attempt. Deleting "
     + ret + ", length="
     + fs.getFileStatus(ret).getLen());
   if (!fs.delete(ret, false)) {
    LOG.warn("Failed delete of old " + ret);
   }
  }
  Path dir = ret.getParent();
  if (!fs.exists(dir)) {
   if (!fs.mkdirs(dir)) LOG.warn("mkdir failed on " + dir);
  }
 } catch (IOException e) {
  LOG.warn("Could not prepare temp staging area ", e);
  // ignore, exceptions will be thrown elsewhere
 }
 return ret;
}

代码示例来源:origin: org.apache.hbase/hbase-server

WALSplitter s = new WALSplitter(wals, conf, rootdir, fs, null, null);
s.splitLogFile(listStatus[0], null);
Path file = new Path(ZKSplitLog.getSplitLogDir(rootdir, listStatus[0].getPath().getName()),
 "corrupt");
assertTrue(!fs.exists(file));

代码示例来源:origin: org.apache.hbase/hbase-server

WALSplitter s = new WALSplitter(wals, conf, rootdir, fs, null, null);
s.splitLogFile(listStatus[0], null);
Path file = new Path(ZKSplitLog.getSplitLogDir(rootdir, listStatus[0].getPath().getName()),
 "corrupt");
assertTrue(fs.exists(file));

相关文章