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


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/meta/TestCkpMetadata.java:
##########
@@ -94,9 +107,17 @@ void testBootstrap() throws Exception {
         metadata1.getInstantCache(), is(Collections.singletonList("4")));
   }
 
-  private CkpMetadata getCkpMetadata(String uniqueId) {
-    String basePath = tempFile.getAbsolutePath();
-    FileSystem fs = FSUtils.getFs(basePath, 
HadoopConfigurations.getHadoopConf(new Configuration()));
-    return CkpMetadata.getInstance(fs, basePath, uniqueId);
+  protected CkpMetadata getCkpMetadata(String uniqueId) {
+    conf.set(FlinkOptions.WRITE_CLIENT_ID, uniqueId);
+    return 
CkpMetadataFactory.getCkpMetadata(writeClient.getHoodieTable().getMetaClient(), 
writeClient.getConfig(), conf);
+  }

Review Comment:
   Create a hoodie table each time is costly.



##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/meta/TestCkpMetadata.java:
##########
@@ -94,9 +107,17 @@ void testBootstrap() throws Exception {
         metadata1.getInstantCache(), is(Collections.singletonList("4")));
   }
 
-  private CkpMetadata getCkpMetadata(String uniqueId) {
-    String basePath = tempFile.getAbsolutePath();
-    FileSystem fs = FSUtils.getFs(basePath, 
HadoopConfigurations.getHadoopConf(new Configuration()));
-    return CkpMetadata.getInstance(fs, basePath, uniqueId);
+  protected CkpMetadata getCkpMetadata(String uniqueId) {
+    conf.set(FlinkOptions.WRITE_CLIENT_ID, uniqueId);
+    return 
CkpMetadataFactory.getCkpMetadata(writeClient.getHoodieTable().getMetaClient(), 
writeClient.getConfig(), conf);
+  }
+
+  @AfterEach
+  public void cleanup() {
+    if (writeClient != null) {
+      writeClient.close();
+      writeClient = null;
+    }
   }
+

Review Comment:
   Unnecessary change.



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