hddong commented on a change in pull request #1157: [HUDI-332]Add operation
type (insert/upsert/bulkinsert/delete) to HoodieCommitMetadata
URL: https://github.com/apache/incubator-hudi/pull/1157#discussion_r386937077
##########
File path:
hudi-client/src/test/java/org/apache/hudi/io/TestHoodieCommitArchiveLog.java
##########
@@ -413,4 +417,32 @@ private void verifyInflightInstants(HoodieTableMetaClient
metaClient, int expect
assertEquals("Loaded inflight clean actions and the count should match",
expectedTotalInstants,
timeline.countInstants());
}
+
+ @Test
+ public void testCommitMetadataConverter() {
+ HoodieCommitMetadata hoodieCommitMetadata = new HoodieCommitMetadata();
+ hoodieCommitMetadata.setOperationType(WriteOperationType.INSERT);
+
+ HoodieWriteConfig cfg = HoodieWriteConfig.newBuilder().withPath(basePath)
+
.withSchema(HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA).withParallelism(2,
2).forTable("test-commitMetadata-converter")
+
.withCompactionConfig(HoodieCompactionConfig.newBuilder().retainCommits(1).archiveCommitsWith(2,
5).build())
+ .build();
+ metaClient = HoodieTableMetaClient.reload(metaClient);
+ HoodieCommitArchiveLog archiveLog = new HoodieCommitArchiveLog(cfg,
metaClient);
+
+ Class<?> clazz = HoodieCommitArchiveLog.class;
+ try {
+ Method commitMetadataConverter =
clazz.getDeclaredMethod("commitMetadataConverter", HoodieCommitMetadata.class);
Review comment:
> @hddong One final comment : Can you make commitMetadataConverter() in
HoodieCommitArchiveLog with default access (instead of private). This way, you
dont need to deal with reflection.
@bvaradar Change to publice access, because `TestHoodieCommitArchiveLog` and
`HoodieCommitArchiveLog` not in the same package path.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services