You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/01/14 07:11:22 UTC

[GitHub] [hudi] wangxianghu commented on a change in pull request #2445: [MINOR] Callback message add partitionPath Field

wangxianghu commented on a change in pull request #2445:
URL: https://github.com/apache/hudi/pull/2445#discussion_r557078101



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/callback/common/HoodieWriteCommitCallbackMessage.java
##########
@@ -41,13 +41,19 @@
    */
   private String basePath;
 
+  /**
+   * partitionPath in hudi table
+   */

Review comment:
       DOC: partiton this commit write into.

##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/callback/common/HoodieWriteCommitCallbackMessage.java
##########
@@ -41,13 +41,19 @@
    */
   private String basePath;
 
+  /**
+   * partitionPath in hudi table
+   */
+  private String partitionPath;
+
   public HoodieWriteCommitCallbackMessage() {
   }
 
-  public HoodieWriteCommitCallbackMessage(String commitTime, String tableName, String basePath) {
+  public HoodieWriteCommitCallbackMessage(String commitTime, String tableName, String basePath, String partitionPath) {

Review comment:
       since we may need more information to send downstream in the future. maybe we can add a configuration for the user to set the fileds they need. then we can avoid change the constructors time by time

##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/AbstractHoodieWriteClient.java
##########
@@ -194,11 +196,14 @@ public boolean commitStats(String instantTime, List<HoodieWriteStat> stats, Opti
     }
 
     // callback if needed.
+    List<String> partitionPath = new ArrayList<>();
+    stats.forEach(stat -> partitionPath.add(stat.getPartitionPath()));
+
     if (config.writeCommitCallbackOn()) {
       if (null == commitCallback) {
         commitCallback = HoodieCommitCallbackFactory.create(config);
       }
-      commitCallback.call(new HoodieWriteCommitCallbackMessage(instantTime, config.getTableName(), config.getBasePath()));
+      commitCallback.call(new HoodieWriteCommitCallbackMessage(instantTime, config.getTableName(), config.getBasePath(), partitionPath.toString()));

Review comment:
       Is there a way to make the logic here extendable, so when the user want more information ,we don't need to make any change here.
   such as  `new HoodieWriteCommitCallbackMessage(instantTime, config, ...)`




----------------------------------------------------------------
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:
users@infra.apache.org