bvaradar commented on a change in pull request #651: Spark Stage retry handling
URL: https://github.com/apache/incubator-hudi/pull/651#discussion_r286188156
##########
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:
Changed the behavior such that If there is an existing log-file without
write-token, we will first rollover to new log version and then start writing.
Also, added consistent ordering of log-files covering cases where there is same
log-version but different write-token.
----------------------------------------------------------------
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