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 2022/06/14 04:13:31 UTC

[GitHub] [hudi] XuQianJin-Stars commented on a diff in pull request #5858: [HUDI-4252] Improve flink init table for StreamWriteFunction

XuQianJin-Stars commented on code in PR #5858:
URL: https://github.com/apache/hudi/pull/5858#discussion_r896355179


##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/HoodieFlinkWriteClient.java:
##########
@@ -152,6 +152,17 @@ public List<WriteStatus> upsert(List<HoodieRecord<T>> records, String instantTim
     return postWrite(result, instantTime, table);
   }
 
+  public List<WriteStatus> upsert(HoodieFlinkTable<T> table, List<HoodieRecord<T>> records, String instantTime) {
+    preWrite(instantTime, WriteOperationType.UPSERT, table.getMetaClient());
+    final HoodieWriteHandle<?, ?, ?, ?> writeHandle = getOrCreateWriteHandle(records.get(0), getConfig(),
+        instantTime, table, records.listIterator());

Review Comment:
   > There is no much sense to reuse the `table` object, we need a fresh new local timeline for the table each time we do the write action, and the timeline construction/refresh takes most of the time for table initialization.
   > 
   > So -1 on this change for correctness and robustness.
   
   From the flame graph, rebuilding the table initialization is time consuming, so I want to reuse this object as much as possible.



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