cshuo commented on code in PR #13285:
URL: https://github.com/apache/hudi/pull/13285#discussion_r2086713396


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -512,12 +512,6 @@ public class HoodieWriteConfig extends HoodieConfig {
       .sinceVersion("1.0.0")
       .withDocumentation("If enabled, writers get instant state from timeline 
server rather than requesting DFS directly");

Review Comment:
   INSTANT_STATE_TIMELINE_SERVER_BASED can be removed. Maybe changes introduced 
in this PR #9651 can all be cleaned?



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/event/WriteMetadataEvent.java:
##########
@@ -38,6 +38,7 @@ public class WriteMetadataEvent implements OperatorEvent {
 
   private List<WriteStatus> writeStatuses;
   private int taskID;
+  private long checkpointId;

Review Comment:
   For `WriteMetaDataEvent` state, it uses `PojoSerializer` as state serializer 
which supports basic [state schema 
evolution](https://nightlies.apache.org/flink/flink-docs-release-2.0/docs/dev/datastream/fault-tolerance/serialization/schema_evolution/#pojo-types),
 including adding new fields, but the new added fields will 
    be default value when recovering from legacy state, i.e., always be -1 for 
checkpointId.



##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/event/Correspondent.java:
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.sink.event;
+
+import org.apache.hudi.common.util.VisibleForTesting;
+import org.apache.hudi.exception.HoodieException;
+
+import org.apache.flink.runtime.jobgraph.OperatorID;
+import org.apache.flink.runtime.jobgraph.tasks.TaskOperatorEventGateway;
+import org.apache.flink.runtime.operators.coordination.CoordinationRequest;
+import org.apache.flink.runtime.operators.coordination.CoordinationResponse;
+import org.apache.flink.util.SerializedValue;
+
+/**
+ * Correspondent between a write task with the coordinator.
+ */
+public class Correspondent {
+  private final OperatorID operatorID;
+  private final TaskOperatorEventGateway gateway;
+  private Correspondent(OperatorID operatorID, TaskOperatorEventGateway 
gateway) {
+    this.operatorID = operatorID;
+    this.gateway = gateway;
+  }
+
+  @VisibleForTesting
+  protected Correspondent() {
+    this.operatorID = null;
+    this.gateway = null;
+  }
+
+  public static Correspondent getInstance(OperatorID operatorID, 
TaskOperatorEventGateway gateway) {
+    return new Correspondent(operatorID, gateway);
+  }
+
+  public String requestInstantTime(long checkpointId) {
+    try {
+      InstantTimeResponse response = (InstantTimeResponse) 
this.gateway.sendRequestToCoordinator(this.operatorID,
+          new 
SerializedValue<>(InstantTimeRequest.getInstance(checkpointId))).get();

Review Comment:
   should we use `get(long timeout, TimeUnit unit)` here? and throw exception 
for fast failing, just in case unexpected stuck.



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