fredia commented on code in PR #26005:
URL: https://github.com/apache/flink/pull/26005#discussion_r1919945668


##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/AsyncExecutionController.java:
##########
@@ -321,12 +321,19 @@ public <IN, OUT> InternalStateFuture<OUT> handleRequest(
     public <IN, OUT> InternalStateFuture<OUT> handleRequest(
             @Nullable State state,
             StateRequestType type,
+            boolean sync,

Review Comment:
   Update comment of this function accordingly?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/AsyncExecutionController.java:
##########
@@ -373,7 +383,15 @@ public <N> void setCurrentNamespaceForState(
     }
 
     <IN, OUT> void insertActiveBuffer(StateRequest<K, ?, IN, OUT> request) {
-        stateRequestsBuffer.enqueueToActive(request);
+        if (request.isSync()) {
+            if (request.getRequestType() == StateRequestType.SYNC_POINT) {
+                request.getFuture().complete(null);
+            } else {
+                stateExecutor.executeRequest(request);
+            }
+        } else {
+            stateRequestsBuffer.enqueueToActive(request);

Review Comment:
   If `!request.isSync()`, will the request be `SYNC_POINT` here?
   Maybe some test call handleRequest(SYNC_POINT) directly.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/StateExecutor.java:
##########
@@ -45,6 +45,13 @@ public interface StateExecutor {
      */
     StateRequestContainer createStateRequestContainer();
 
+    /**
+     * Execute a single state request *synchronously*. This is for synchronous 
APIs.
+     *
+     * @param stateRequest the request to run.
+     */
+    void executeRequest(StateRequest<?, ?, ?, ?> stateRequest);

Review Comment:
   nit: `executeRequest` -> `executeRequestSync`



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