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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/ConsistentBucketIndexUtils.java:
##########
@@ -177,25 +179,45 @@ public static Option<HoodieConsistentHashingMetadata> 
loadMetadata(HoodieTable t
   /**
    * Saves the metadata into storage
    *
-   * @param table     Hoodie table
-   * @param metadata  Hashing metadata to be saved
-   * @param overwrite Whether to overwrite existing metadata
+   * @param table    Hoodie table
+   * @param metadata Hashing metadata to be saved
    * @return true if the metadata is saved successfully
    */
-  public static boolean saveMetadata(HoodieTable table, 
HoodieConsistentHashingMetadata metadata, boolean overwrite) {
+  public static boolean saveMetadata(HoodieTable table, 
HoodieConsistentHashingMetadata metadata) {
     HoodieStorage storage = table.getStorage();
     StoragePath dir = FSUtils.constructAbsolutePath(
         table.getMetaClient().getHashingMetadataPath(), 
metadata.getPartitionPath());
+    StoragePath tmpDir = FSUtils.constructAbsolutePath(dir, TEMP_DIR);
     StoragePath fullPath = new StoragePath(dir, metadata.getFilename());
-    try (OutputStream out = storage.create(fullPath, overwrite)) {
+    StoragePath tmpPath = new StoragePath(tmpDir, UUID.randomUUID() + "-" + 
metadata.getFilename());

Review Comment:
   Can `HoodieStorage.createImmutableFileInPath` be utilitized here?



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