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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/bulk/BulkInsertWriteFunction.java:
##########
@@ -113,7 +116,8 @@ public BulkInsertWriteFunction(Configuration config, 
RowType rowType) {
   public void open(Configuration parameters) throws IOException {
     this.taskID = getRuntimeContext().getIndexOfThisSubtask();
     this.writeClient = FlinkWriteClients.createWriteClient(this.config, 
getRuntimeContext());
-    this.ckpMetadata = CkpMetadata.getInstance(config);
+    HoodieTableMetaClient metaClient = 
StreamerUtil.createMetaClient(this.config);
+    this.ckpMetadata = CkpMetadataFactory.getCkpMetadata(metaClient, 
writeClient.getConfig(), config);

Review Comment:
   Yes, we can create the `CkpMetadata` only by `HoodieWriteConfig ` and 
`Configuration `. I've updated the code as you suggested. 



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/meta/CkpMetadata.java:
##########
@@ -208,21 +200,6 @@ public List<String> getInstantCache() {
     return this.instantCache;
   }
 
-  // -------------------------------------------------------------------------
-  //  Utilities
-  // -------------------------------------------------------------------------

Review Comment:
   done



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/meta/CkpMetadata.java:
##########
@@ -249,4 +230,5 @@ private List<CkpMessage> scanCkpMetadata(Path ckpMetaPath) 
throws IOException {
         }).get())
         .sorted().collect(Collectors.toList());
   }
+

Review Comment:
   done



##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/meta/TestCkpMetadata.java:
##########
@@ -49,11 +53,24 @@ public class TestCkpMetadata {
   @TempDir
   File tempFile;
 
+  protected Configuration conf;
+
+  protected HoodieFlinkWriteClient writeClient;
+
+  protected HoodieTableMetaClient metaClient;
+
   @BeforeEach
   public void beforeEach() throws Exception {
+    setup();
+  }
+
+  protected void setup() throws IOException {
     String basePath = tempFile.getAbsolutePath();
-    Configuration conf = TestConfigurations.getDefaultConf(basePath);
+    this.conf = TestConfigurations.getDefaultConf(basePath);
+    
conf.setString(HoodieWriteConfig.INSTANT_STATE_TIMELINE_SERVER_BASED.key(), 
"false");

Review Comment:
   done



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