vinothchandar commented on a change in pull request #651: Spark Stage retry
handling
URL: https://github.com/apache/incubator-hudi/pull/651#discussion_r285289919
##########
File path: hoodie-common/src/main/java/com/uber/hoodie/common/util/FSUtils.java
##########
@@ -254,6 +313,53 @@ public static String getBaseCommitTimeFromLogPath(Path
path) {
return matcher.group(2);
}
+ /**
+ * Get TaskId used in log-path
+ */
+ public static Integer getTaskPartitionIdFromLogPath(Path path) {
+ Matcher matcher = LOG_FILE_PATTERN.matcher(path.getName());
+ if (!matcher.find()) {
+ throw new InvalidHoodiePathException(path, "LogFile");
+ }
+ String val = matcher.group(7);
+ return val == null ? null : Integer.parseInt(val);
+ }
+
+ /**
+ * Get Write-Token used in log-path
+ */
+ public static String getWriteTokenFromLogPath(Path path) {
+ Matcher matcher = LOG_FILE_PATTERN.matcher(path.getName());
+ if (!matcher.find()) {
+ throw new InvalidHoodiePathException(path, "LogFile");
Review comment:
how do you intend to handle existing logs that don't have a write token? log
writer picks up `writeToken` passed in `orElse` above and writes to a new log
file?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services