yunfengzhou-hub commented on code in PR #24667:
URL: https://github.com/apache/flink/pull/24667#discussion_r1566742123


##########
flink-core/src/main/java/org/apache/flink/configuration/ExecutionOptions.java:
##########
@@ -181,4 +182,73 @@ public class ExecutionOptions {
                                     + " operators. NOTE: It takes effect only 
in the BATCH runtime mode and requires sorted inputs"
                                     + SORT_INPUTS.key()
                                     + " to be enabled.");
+
+    /**
+     * A flag to enable or disable async mode related components when tasks 
initialize. As long as
+     * this option is enabled, the state access of Async state APIs will be 
executed asynchronously.
+     * Otherwise, the state access of Async state APIs will be executed 
synchronously. For Sync
+     * state APIs, the state access is always executed synchronously, enable 
this option would bring
+     * some overhead.
+     *
+     * <p>Note: This is an experimental feature(FLIP-425) under evaluation.
+     */
+    @Experimental
+    public static final ConfigOption<Boolean> ASYNC_STATE_ENABLED =
+            ConfigOptions.key("execution.async-mode.enabled")
+                    .booleanType()
+                    .defaultValue(false)
+                    .withDescription(
+                            "A flag to enable or disable async mode related 
components when tasks initialize."
+                                    + " As long as this option is enabled, the 
state access of Async state APIs will be executed asynchronously."
+                                    + " Otherwise, the state access of Async 
state APIs will be executed synchronously."
+                                    + " For Sync state APIs, the state access 
is always executed synchronously, enable this option would bring some 
overhead.\n"

Review Comment:
   It might be better to remove this configuration for now and add it in future 
when such use cases are found.
   
   - Whether to enable async state access can be inferred automatically by the 
Flink infrastructure, depending on the location of state backends and the state 
API used in operators.
   - It is better not to expose implementation details, like the sync/async 
modes mentioned here, to end users. So long as the order to same-key records 
and the order of async state callbacks are guaranteed, that is enough for users.
       - Especially, the implementation in the sync mode might be altered in 
future, in order to improve performance in situations where sync state API + 
remote state backend is used. In this case the statement "the state access is 
always executed synchronously" might cause deprecation issues.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to