CTTY commented on code in PR #6882:
URL: https://github.com/apache/hudi/pull/6882#discussion_r989549950


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieWriteHandle.java:
##########
@@ -158,27 +161,29 @@ private String makeWriteToken() {
     return FSUtils.makeWriteToken(getPartitionId(), getStageId(), 
getAttemptId());
   }
 
-  public Path makeNewPath(String partitionPath) {
-    Path path = FSUtils.getPartitionPath(config.getBasePath(), partitionPath);
+  public Path makeNewPhysicalPath(String partitionPath) {
+    String storageLocation = storageStrategy.storageLocation(partitionPath, 
fileId);
+    Path path = new Path(storageLocation);
     try {
       if (!fs.exists(path)) {
         fs.mkdirs(path); // create a new partition as needed.
       }
     } catch (IOException e) {
       throw new HoodieIOException("Failed to make dir " + path, e);
     }
+    LOG.info("write handle, physical partition path: " + path);
 
-    return new Path(path.toString(), FSUtils.makeBaseFileName(instantTime, 
writeToken, fileId,
+    return new Path(storageLocation, FSUtils.makeBaseFileName(instantTime, 
writeToken, fileId,
         
hoodieTable.getMetaClient().getTableConfig().getBaseFileFormat().getFileExtension()));
   }
 
   /**
    * Make new file path with given file name.
    */
-  protected Path makeNewFilePath(String partitionPath, String fileName) {
-    String relativePath = new Path((partitionPath.isEmpty() ? "" : 
partitionPath + "/")
-        + fileName).toString();
-    return new Path(config.getBasePath(), relativePath);
+  protected Path makeNewFilePhysicalPath(String partitionPath, String 
fileName) {
+    String storageLocation = storageStrategy.storageLocation(partitionPath, 
fileId);
+
+    return new Path(storageLocation, fileName);

Review Comment:
   Obtaining physical path on the writing side



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