Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ static List<File> parseZkLogs(String zkLogDir, long start, long end) {
FileUtils.copyFileToDirectory(zkLog, zkParsedDir);
File zkLogGz = new File(zkParsedDir, zkLog.getName());
File tmpZkLog = gunzip(zkLogGz);

if (tmpZkLog == null) {
return null;
}
// parse gunzip file
ZKLogFormatter
.main(new String[] { log, tmpZkLog.getAbsolutePath(), parsedZkLog.getAbsolutePath()
Expand Down Expand Up @@ -501,7 +503,9 @@ static File[] parseZkSnapshot(String zkSnapshotDir, long byTime) {
FileUtils.copyFileToDirectory(lastZkSnapshot, zkParsedDir);
File lastZkSnapshotGz = new File(zkParsedDir, lastZkSnapshot.getName());
File tmpLastZkSnapshot = gunzip(lastZkSnapshotGz);

if (tmpLastZkSnapshot == null) {
return null;
}
// parse gunzip file
ZKLogFormatter.main(new String[] {
snapshot, tmpLastZkSnapshot.getAbsolutePath(), parsedZkSnapshot.getAbsolutePath()
Expand Down Expand Up @@ -607,6 +611,10 @@ public static void processCommandLineArgs(String[] cliArgs) {
}
// zkDataDirs[0] is the transaction log dir
List<File> parsedZkLogs = parseZkLogs(zkDataDirs[0], startTime, endTime);
if (parsedZkLogs == null) {
LOG.error("fail to gunzip file" + zkDataDirs[0]);
System.exit(1);
}
grepZkLogDir(parsedZkLogs, startTime, endTime, patterns);

} else if (cmd.hasOption(by)) {
Expand All @@ -621,7 +629,10 @@ public static void processCommandLineArgs(String[] cliArgs) {

// zkDataDirs[1] is the snapshot dir
File[] lastZkSnapshot = parseZkSnapshot(zkDataDirs[1], byTime);

if (lastZkSnapshot == null){
LOG.error("fail to gunzip file" + zkDataDirs[1]);
System.exit(1);
}
// lastZkSnapshot[1] is the parsed last snapshot by byTime
grepZkSnapshot(lastZkSnapshot[1], patterns);

Expand Down