huwh commented on code in PR #23399:
URL: https://github.com/apache/flink/pull/23399#discussion_r1325871369
##########
docs/content.zh/docs/deployment/advanced/failure_enrichers.md:
##########
@@ -21,34 +21,33 @@ specific language governing permissions and limitations
under the License.
-->
-## Custom failure enrichers
-Flink provides a pluggable interface for users to register their custom logic
and enrich failures with extra metadata labels (string key-value pairs).
-This enables users to implement their own failure enrichment plugins to
categorize job failures, expose custom metrics, or make calls to external
notification systems.
+## 自定义故障丰富器(Failure Enricher)
-FailureEnrichers are triggered every time an exception is reported at runtime
by the JobManager.
-Every FailureEnricher may asynchronously return labels associated with the
failure that are then exposed via the JobManager's REST API (e.g., a
'type:System' label implying the failure is categorized as a system error).
+Flink 提供了一个可插拔的接口,供用户注册他们自定义的逻辑,并使用额外的元数据标签(字符串类型的 key-value
对)来丰富故障(Failure)信息。
+这使得用户可以实现自定义的故障丰富器插件,对作业故障进行分类、对外暴露自定义指标,或者调用外部通知系统。
+每当 JobManager 在运行时收到异常时,都会触发 FailureEnrichers。
+每个 FailureEnricher 可以异步返回故障对应的标签(labels),这些标签可以通过 JobManager 的 REST API
来查询(例如:"type:System" 的标签意味着该故障被分类为系统错误)。
-### Implement a plugin for your custom enricher
+### 实现一个自定义的故障丰富器插件
-To implement a custom FailureEnricher plugin, you need to:
+要实现自定义的 FailureEnricher 插件,需要按照下面的步骤:
-- Add your own FailureEnricher by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricher.java"
name="FailureEnricher" >}} interface.
+- 通过实现 FailureEnricher 接口,添加自定义的 FailureEnricher;
-- Add your own FailureEnricherFactory by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricherFactory.java"
name="FailureEnricherFactory" >}} interface.
+- 通过实现 FailureEnricherFactory 接口,添加自定义的 FailureEnricherFactory;
Review Comment:
ditto
##########
docs/content.zh/docs/deployment/advanced/failure_enrichers.md:
##########
@@ -21,34 +21,33 @@ specific language governing permissions and limitations
under the License.
-->
-## Custom failure enrichers
-Flink provides a pluggable interface for users to register their custom logic
and enrich failures with extra metadata labels (string key-value pairs).
-This enables users to implement their own failure enrichment plugins to
categorize job failures, expose custom metrics, or make calls to external
notification systems.
+## 自定义故障丰富器(Failure Enricher)
-FailureEnrichers are triggered every time an exception is reported at runtime
by the JobManager.
-Every FailureEnricher may asynchronously return labels associated with the
failure that are then exposed via the JobManager's REST API (e.g., a
'type:System' label implying the failure is categorized as a system error).
+Flink 提供了一个可插拔的接口,供用户注册他们自定义的逻辑,并使用额外的元数据标签(字符串类型的 key-value
对)来丰富故障(Failure)信息。
+这使得用户可以实现自定义的故障丰富器插件,对作业故障进行分类、对外暴露自定义指标,或者调用外部通知系统。
+每当 JobManager 在运行时收到异常时,都会触发 FailureEnrichers。
+每个 FailureEnricher 可以异步返回故障对应的标签(labels),这些标签可以通过 JobManager 的 REST API
来查询(例如:"type:System" 的标签意味着该故障被分类为系统错误)。
-### Implement a plugin for your custom enricher
+### 实现一个自定义的故障丰富器插件
-To implement a custom FailureEnricher plugin, you need to:
+要实现自定义的 FailureEnricher 插件,需要按照下面的步骤:
-- Add your own FailureEnricher by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricher.java"
name="FailureEnricher" >}} interface.
+- 通过实现 FailureEnricher 接口,添加自定义的 FailureEnricher;
Review Comment:
Can we keep the source code link here?
##########
docs/content.zh/docs/deployment/advanced/failure_enrichers.md:
##########
@@ -21,34 +21,33 @@ specific language governing permissions and limitations
under the License.
-->
-## Custom failure enrichers
-Flink provides a pluggable interface for users to register their custom logic
and enrich failures with extra metadata labels (string key-value pairs).
-This enables users to implement their own failure enrichment plugins to
categorize job failures, expose custom metrics, or make calls to external
notification systems.
+## 自定义故障丰富器(Failure Enricher)
-FailureEnrichers are triggered every time an exception is reported at runtime
by the JobManager.
-Every FailureEnricher may asynchronously return labels associated with the
failure that are then exposed via the JobManager's REST API (e.g., a
'type:System' label implying the failure is categorized as a system error).
+Flink 提供了一个可插拔的接口,供用户注册他们自定义的逻辑,并使用额外的元数据标签(字符串类型的 key-value
对)来丰富故障(Failure)信息。
+这使得用户可以实现自定义的故障丰富器插件,对作业故障进行分类、对外暴露自定义指标,或者调用外部通知系统。
+每当 JobManager 在运行时收到异常时,都会触发 FailureEnrichers。
+每个 FailureEnricher 可以异步返回故障对应的标签(labels),这些标签可以通过 JobManager 的 REST API
来查询(例如:"type:System" 的标签意味着该故障被分类为系统错误)。
-### Implement a plugin for your custom enricher
+### 实现一个自定义的故障丰富器插件
-To implement a custom FailureEnricher plugin, you need to:
+要实现自定义的 FailureEnricher 插件,需要按照下面的步骤:
-- Add your own FailureEnricher by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricher.java"
name="FailureEnricher" >}} interface.
+- 通过实现 FailureEnricher 接口,添加自定义的 FailureEnricher;
-- Add your own FailureEnricherFactory by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricherFactory.java"
name="FailureEnricherFactory" >}} interface.
+- 通过实现 FailureEnricherFactory 接口,添加自定义的 FailureEnricherFactory;
-- Add a service entry. Create a file
`META-INF/services/org.apache.flink.core.failure.FailureEnricherFactory` which
contains the class name of your failure enricher factory class (see [Java
Service
Loader](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html)
docs for more details).
+- 添加一个 Service 入口,创建一个文件
`META-INF/services/org.apache.flink.core.failure.FailureEnricherFactory`,文件中包含自定义
FailureEnricherFactory 的类名(有关详细信息,请参阅 [Java Service
Loader](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html)
文档)。
-
-Then, create a jar which includes your `FailureEnricher`,
`FailureEnricherFactory`, `META-INF/services/` and all external dependencies.
-Make a directory in `plugins/` of your Flink distribution with an arbitrary
name, e.g. "failure-enrichment", and put the jar into this directory.
-See [Flink Plugin]({% link deployment/filesystems/plugins.md %}) for more
details.
+然后,创建一个包含 `FailureEnricher`,`FailureEnricherFactory`,`META-INF/services/`
和所有外部依赖项的 jar 文件。
+在 Flink Deploy 目录中的 `plugins/` 目录中创建一个任意名称的目录,例如 "failure-enrichment",并将 jar
文件放入此目录中。
+使用方式与其它 Plugin 是类似的,有关的详细信息,请参考 [Flink插件]({{< ref
"docs/deployment/filesystems/plugins" >}})。
Review Comment:
[Flink插件] -> [Flink Plugins]
I think keep the Flink Plugins in english is fine, like other Chinese
documents.
##########
docs/content.zh/docs/deployment/advanced/failure_enrichers.md:
##########
@@ -21,34 +21,33 @@ specific language governing permissions and limitations
under the License.
-->
-## Custom failure enrichers
-Flink provides a pluggable interface for users to register their custom logic
and enrich failures with extra metadata labels (string key-value pairs).
-This enables users to implement their own failure enrichment plugins to
categorize job failures, expose custom metrics, or make calls to external
notification systems.
+## 自定义故障丰富器(Failure Enricher)
-FailureEnrichers are triggered every time an exception is reported at runtime
by the JobManager.
-Every FailureEnricher may asynchronously return labels associated with the
failure that are then exposed via the JobManager's REST API (e.g., a
'type:System' label implying the failure is categorized as a system error).
+Flink 提供了一个可插拔的接口,供用户注册他们自定义的逻辑,并使用额外的元数据标签(字符串类型的 key-value
对)来丰富故障(Failure)信息。
+这使得用户可以实现自定义的故障丰富器插件,对作业故障进行分类、对外暴露自定义指标,或者调用外部通知系统。
+每当 JobManager 在运行时收到异常时,都会触发 FailureEnrichers。
+每个 FailureEnricher 可以异步返回故障对应的标签(labels),这些标签可以通过 JobManager 的 REST API
来查询(例如:"type:System" 的标签意味着该故障被分类为系统错误)。
-### Implement a plugin for your custom enricher
+### 实现一个自定义的故障丰富器插件
-To implement a custom FailureEnricher plugin, you need to:
+要实现自定义的 FailureEnricher 插件,需要按照下面的步骤:
-- Add your own FailureEnricher by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricher.java"
name="FailureEnricher" >}} interface.
+- 通过实现 FailureEnricher 接口,添加自定义的 FailureEnricher;
-- Add your own FailureEnricherFactory by implementing the {{< gh_link
file="/flink-core/src/main/java/org/apache/flink/core/failure/FailureEnricherFactory.java"
name="FailureEnricherFactory" >}} interface.
+- 通过实现 FailureEnricherFactory 接口,添加自定义的 FailureEnricherFactory;
-- Add a service entry. Create a file
`META-INF/services/org.apache.flink.core.failure.FailureEnricherFactory` which
contains the class name of your failure enricher factory class (see [Java
Service
Loader](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html)
docs for more details).
+- 添加一个 Service 入口,创建一个文件
`META-INF/services/org.apache.flink.core.failure.FailureEnricherFactory`,文件中包含自定义
FailureEnricherFactory 的类名(有关详细信息,请参阅 [Java Service
Loader](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html)
文档)。
-
-Then, create a jar which includes your `FailureEnricher`,
`FailureEnricherFactory`, `META-INF/services/` and all external dependencies.
-Make a directory in `plugins/` of your Flink distribution with an arbitrary
name, e.g. "failure-enrichment", and put the jar into this directory.
-See [Flink Plugin]({% link deployment/filesystems/plugins.md %}) for more
details.
+然后,创建一个包含 `FailureEnricher`,`FailureEnricherFactory`,`META-INF/services/`
和所有外部依赖项的 jar 文件。
+在 Flink Deploy 目录中的 `plugins/` 目录中创建一个任意名称的目录,例如 "failure-enrichment",并将 jar
文件放入此目录中。
+使用方式与其它 Plugin 是类似的,有关的详细信息,请参考 [Flink插件]({{< ref
"docs/deployment/filesystems/plugins" >}})。
Review Comment:
[Flink插件] -> [Flink Plugins]
I think keep the Flink Plugins in english is fine, like other Chinese
documents.
--
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]