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/09/21 12:52:05 UTC

[GitHub] [hudi] vinothchandar commented on a change in pull request #3695: [HUDI-2395] Metadata tests rewrite

vinothchandar commented on a change in pull request #3695:
URL: https://github.com/apache/hudi/pull/3695#discussion_r713006621



##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/testutils/HoodieClientTestHarness.java
##########
@@ -418,4 +445,166 @@ public HoodieTableFileSystemView getHoodieTableFileSystemView(HoodieTableMetaCli
     }
     return Pair.of(partitionPathStatMap, globalStat);
   }
+
+  /**
+   * Validate the metadata tables contents to ensure it matches what is on the file system.
+   */
+  public void validateMetadata(HoodieTestTable testTable, List<String> inflightCommits, HoodieWriteConfig writeConfig, String metadataTableBasePath) throws IOException {

Review comment:
       this is very very long method. 

##########
File path: hudi-common/src/test/java/org/apache/hudi/common/testutils/HoodieTestTable.java
##########
@@ -144,6 +186,25 @@ public HoodieTestTable addCommit(String instantTime) throws Exception {
     return this;
   }
 
+  public HoodieCommitMetadata createCommitMetadata(WriteOperationType operationType, String commitTime, HoodieTestTableState testTableState) {
+    String actionType = MERGE_ON_READ.equals(metaClient.getTableType()) ? DELTA_COMMIT_ACTION : COMMIT_ACTION;
+    return createCommitMetadata(operationType, commitTime, Collections.emptyMap(), testTableState, false, actionType);
+  }
+
+  public HoodieCommitMetadata createCommitMetadata(WriteOperationType operationType, String commitTime,
+                                                   HoodieTestTableState testTableState, boolean bootstrap) {
+    String actionType = MERGE_ON_READ.equals(metaClient.getTableType()) ? DELTA_COMMIT_ACTION : COMMIT_ACTION;

Review comment:
       is nt there a direct method to get the commit action type?
   




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org