/** * Make sure that the file set are gotten by calling {@link #getLogFiles()}, where we will sort * the file set by log id. * @return Max-LogID of the specified log file set */ private long initOldLogs(FileStatus[] logFiles) throws IOException { if (logFiles == null || logFiles.length == 0) { return 0L; } long maxLogId = 0; for (int i = 0; i < logFiles.length; ++i) { final Path logPath = logFiles[i].getPath(); leaseRecovery.recoverFileLease(fs, logPath); if (!isRunning()) { throw new IOException("wal aborting"); } maxLogId = Math.max(maxLogId, getLogIdFromName(logPath.getName())); ProcedureWALFile log = initOldLog(logFiles[i], this.walArchiveDir); if (log != null) { this.logs.add(log); } } initTrackerFromOldLogs(); return maxLogId; }
/** * @return Max-LogID of the specified log file set */ private long initOldLogs(final FileStatus[] logFiles) throws IOException { this.logs.clear(); long maxLogId = 0; if (logFiles != null && logFiles.length > 0) { for (int i = 0; i < logFiles.length; ++i) { final Path logPath = logFiles[i].getPath(); leaseRecovery.recoverFileLease(fs, logPath); maxLogId = Math.max(maxLogId, getLogIdFromName(logPath.getName())); ProcedureWALFile log = initOldLog(logFiles[i]); if (log != null) { this.logs.add(log); } } Collections.sort(this.logs); initTrackerFromOldLogs(); } return maxLogId; }
/** * @return Max-LogID of the specified log file set */ private long initOldLogs(final FileStatus[] logFiles) throws IOException { this.logs.clear(); long maxLogId = 0; if (logFiles != null && logFiles.length > 0) { for (int i = 0; i < logFiles.length; ++i) { final Path logPath = logFiles[i].getPath(); leaseRecovery.recoverFileLease(fs, logPath); if (!isRunning()) { throw new IOException("wal aborting"); } maxLogId = Math.max(maxLogId, getLogIdFromName(logPath.getName())); ProcedureWALFile log = initOldLog(logFiles[i], this.walArchiveDir); if (log != null) { this.logs.add(log); } } Collections.sort(this.logs); initTrackerFromOldLogs(); } return maxLogId; }
/** * Make sure that the file set are gotten by calling {@link #getLogFiles()}, where we will sort * the file set by log id. * @return Max-LogID of the specified log file set */ private long initOldLogs(FileStatus[] logFiles) throws IOException { if (logFiles == null || logFiles.length == 0) { return 0L; } long maxLogId = 0; for (int i = 0; i < logFiles.length; ++i) { final Path logPath = logFiles[i].getPath(); leaseRecovery.recoverFileLease(fs, logPath); if (!isRunning()) { throw new IOException("wal aborting"); } maxLogId = Math.max(maxLogId, getLogIdFromName(logPath.getName())); ProcedureWALFile log = initOldLog(logFiles[i], this.walArchiveDir); if (log != null) { this.logs.add(log); } } initTrackerFromOldLogs(); return maxLogId; }