zhuzhurk commented on code in PR #21807:
URL: https://github.com/apache/flink/pull/21807#discussion_r1093174326
##########
docs/content/docs/deployment/speculative_execution.md:
##########
@@ -92,6 +88,31 @@ No extra change is required for other sources to work with
speculative execution
and {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/api/connector/source/Source.java"
name="new sources" >}}.
All the source connectors offered by Apache Flink can work with speculative
execution.
+### Enable Sinks for Speculative Execution
+Speculative execution is disabled by default for Sink unless it implements {{<
gh_link
file="/flink-core/src/main/java/org/apache/flink/api/common/SupportsConcurrentExecutionAttempts.java"
name="SupportsConcurrentExecutionAttempts" >}}
Review Comment:
Sink -> a sink
##########
docs/content.zh/docs/deployment/speculative_execution.md:
##########
@@ -83,6 +79,29 @@ public interface SupportsHandleExecutionAttemptSourceEvent {
和 {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/api/connector/source/Source.java"
name="新版 Source" >}}.
Apache Flink 官方提供的 Source 都支持预测执行。
+### 让 Sink 支持预测执行
+Sink 的预测执行默认是关闭的,除非 Sink 实现了 {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/api/common/SupportsConcurrentExecutionAttempts.java"
name="SupportsConcurrentExecutionAttempts" >}}
+接口。这里主要是兼容性方面的考虑。
+```java
+public interface SupportsConcurrentExecutionAttempts {}
+```
+接口 {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/api/common/SupportsConcurrentExecutionAttempts.java"
name="SupportsConcurrentExecutionAttempts" >}}
+适用于 {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/api/connector/sink2/Sink.java"
name="Sink" >}}
+,{{< gh_link
file="/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SinkFunction.java"
name="SinkFunction" >}}
+以及 {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/api/common/io/OutputFormat.java"
name="OutputFormat" >}}。
+
+{{< hint info >}}
+相比于预测执行,目前 Flink 会优先计算算子链接。意思是 Flink 先计算算子是否可以链接在一起,然后在检查链接后的任务是否可以支持预测执行。
Review Comment:
Maybe simplify it a bit "如果作业节点中有任何算子不支持预测执行,那么该节点都将被认为不支持预测执行。这意味着如果 Sink
不支持预测执行,那么包含其的整个节点都无法进行预测执行。"
##########
docs/content.zh/docs/deployment/speculative_execution.md:
##########
@@ -40,10 +40,6 @@ under the License.
## 使用方法
Review Comment:
I noticed an existing problem that on the navigation bar of zh pages, it's
"Speculative Execution" instead of "预测执行".
Could you add a hotfix to fix it?
--
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]