danny0405 commented on code in PR #9776:
URL: https://github.com/apache/hudi/pull/9776#discussion_r1349441899


##########
hudi-common/src/main/java/org/apache/hudi/common/fs/FSUtils.java:
##########
@@ -544,15 +543,27 @@ public static Option<Pair<Integer, String>> 
getLatestLogVersion(FileSystem fs, P
   }
 
   /**
-   * computes the next log version for the specified fileId in the partition 
path.
+   * Returns whether the given path exists on the filesystem or false if any 
exception occurs.
    */
-  public static int computeNextLogVersion(FileSystem fs, Path partitionPath, 
final String fileId,
-      final String logFileExtension, final String baseCommitTime) throws 
IOException {
-    Option<Pair<Integer, String>> currentVersionWithWriteToken =
-        getLatestLogVersion(fs, partitionPath, fileId, logFileExtension, 
baseCommitTime);
-    // handle potential overflow
-    return (currentVersionWithWriteToken.isPresent()) ? 
currentVersionWithWriteToken.get().getKey() + 1
-        : HoodieLogFile.LOGFILE_BASE_VERSION;
+  private static boolean fileExists(FileSystem fs, Path path) {
+    try {
+      return fs.exists(path);
+    } catch (Exception ignored) {
+      return false;
+    }
+  }
+
+  /**
+   * Computes the next log version for the specified fileId in the partition 
path.
+   */
+  public static int computeNextLogVersion(int curVersion, FileSystem fs, Path 
partitionPath, final String fileId,

Review Comment:
   Yes, removed.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to