JunRuiLee commented on code in PR #23847:
URL: https://github.com/apache/flink/pull/23847#discussion_r1413345247


##########
docs/content/docs/ops/state/task_failure_recovery.md:
##########
@@ -117,11 +116,11 @@ The fixed delay restart strategy can also be set 
programmatically:
 {{< tabs "73f5d009-b9af-4bfe-be22-d1c4659fd1ec" >}}
 {{< tab "Java" >}}
 ```java
-StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
-env.setRestartStrategy(RestartStrategies.fixedDelayRestart(
-  3, // number of restart attempts
-  Time.of(10, TimeUnit.SECONDS) // delay
-));
+Configuration config = new Configuration();
+config.set(RestartStrategyOptions.RESTART_STRATEGY, "fixed-delay");
+config.set(RestartStrategyOptions.RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS, 3); 
// number of restart attempts
+config.set(RestartStrategyOptions.RESTART_STRATEGY_FIXED_DELAY_DELAY, 
Duration.ofSeconds(10)); // delay
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment(config);
 ```

Review Comment:
   Thank you for bringing this up. I do see the value in providing a 
programmatic set example. While it's true that the YAML demo illustrates the 
default configuration through the conf file, offering a code snippet showing 
how to set the restart strategy programmatically can be beneficial. This would 
highlight that the restart strategy can be tailored at the job level, giving 
users the flexibility to make adjustments within their code, which can be 
particularly useful in scenarios where different jobs may require different 
strategies.
   
   Informing users about both methods empowers them with a choice to select the 
most appropriate configuration approach based on their specific use case.
   
   Looking forward to your thoughts on this.



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