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



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/AbstractHoodieWriteClient.java
##########
@@ -359,10 +388,21 @@ public abstract O bulkInsertPreppedRecords(I 
preppedRecords, final String instan
    * Common method containing steps to be performed before write 
(upsert/insert/...
    * @param instantTime
    * @param writeOperationType
+   * @param metaClient
    */
-  protected void preWrite(String instantTime, WriteOperationType 
writeOperationType) {
+  protected void preWrite(String instantTime, WriteOperationType 
writeOperationType,
+      HoodieTableMetaClient metaClient) {
     setOperationType(writeOperationType);
-    syncTableMetadata();
+    
this.txnManager.setLastCompletedTransaction(metaClient.getActiveTimeline().getCommitsTimeline().filterCompletedInstants()
+        .lastInstant());
+    LOG.info("Last Instant Cached by writer with instant " + instantTime + " 
is " + this.txnManager.getLastCompletedTransactionOwner());
+    this.txnManager.setTransactionOwner(Option.of(new 
HoodieInstant(State.INFLIGHT, metaClient.getCommitActionType(), instantTime)));
+    this.txnManager.beginTransaction();

Review comment:
       Understood. but if some calls are needed prior to this, then either the 
object constructor should take them or the method should take them as 
arguments. Or we have a transaction builder or sorts. 
   So I would say, if this is always the case, i.e the setters are needed, then 
we change the beginTransaction() signature for good, not just an overload. 




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


Reply via email to