HDFS-15044. [Dynamometer] Show the line of audit log when parsing it unsuccessfully. (#1749)

This commit is contained in:
Takanobu Asanuma 2019-12-13 00:48:14 +09:00 committed by Erik Krogen
parent bdd00f10b4
commit c210cede5c
1 changed files with 5 additions and 3 deletions

View File

@ -125,8 +125,9 @@ public class AuditLogDirectParser implements AuditCommandParser {
relativeTimestamp = dateFormat.parse(m.group("timestamp")).getTime() relativeTimestamp = dateFormat.parse(m.group("timestamp")).getTime()
- startTimestamp; - startTimestamp;
} catch (ParseException p) { } catch (ParseException p) {
throw new IOException("Exception while parsing timestamp from audit log", throw new IOException(
p); "Exception while parsing timestamp from audit log line: `"
+ inputLine + "`", p);
} }
// Sanitize the = in the rename options field into a : so we can split on = // Sanitize the = in the rename options field into a : so we can split on =
String auditMessageSanitized = String auditMessageSanitized =
@ -141,7 +142,8 @@ public class AuditLogDirectParser implements AuditCommandParser {
parameterMap.put(splitMessage[0], splitMessage[1]); parameterMap.put(splitMessage[0], splitMessage[1]);
} catch (ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
throw new IOException( throw new IOException(
"Exception while parsing a message from audit log", e); "Exception while parsing a message from audit log line: `"
+ inputLine + "`", e);
} }
} }