You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ga...@apache.org on 2022/02/23 09:21:34 UTC
[flink] branch master updated: [FLINK-25798][docs-zh] Translate datastream/formats/text_files.md page into Chinese.
This is an automated email from the ASF dual-hosted git repository.
gaoyunhaii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 26b5da3 [FLINK-25798][docs-zh] Translate datastream/formats/text_files.md page into Chinese.
26b5da3 is described below
commit 26b5da39a1f2016fcbcfc06d3cafeec2c7f23871
Author: Roc Marshal <fl...@126.com>
AuthorDate: Mon Jan 24 23:47:59 2022 +0800
[FLINK-25798][docs-zh] Translate datastream/formats/text_files.md page into Chinese.
This closes #18493.
---
.../connectors/datastream/formats/text_files.md | 25 +++++++++++-----------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/docs/content.zh/docs/connectors/datastream/formats/text_files.md b/docs/content.zh/docs/connectors/datastream/formats/text_files.md
index bece984..2f0cbbf 100644
--- a/docs/content.zh/docs/connectors/datastream/formats/text_files.md
+++ b/docs/content.zh/docs/connectors/datastream/formats/text_files.md
@@ -28,8 +28,8 @@ under the License.
# Text files format
-Flink supports reading from text lines from a file using `TextLineInputFormat`. This format uses Java's built-in InputStreamReader to decode the byte stream using various supported charset encodings.
-To use the format you need to add the Flink Connector Files dependency to your project:
+Flink 支持使用 `TextLineInputFormat` 从文件中读取文本行。此 format 使用 Java 的内置 InputStreamReader 以支持的字符集编码来解码字节流。
+要使用该 format,你需要将 Flink Connector Files 依赖项添加到项目中:
```xml
<dependency>
@@ -39,15 +39,15 @@ To use the format you need to add the Flink Connector Files dependency to your p
</dependency>
```
-This format is compatible with the new Source that can be used in both batch and streaming modes.
-Thus, you can use this format in two ways:
-- Bounded read for batch mode
-- Continuous read for streaming mode: monitors a directory for new files that appear
+此 format 与新 Source 兼容,可以在批处理和流模式下使用。
+因此,你可以通过两种方式使用此 format:
+- 批处理模式的有界读取
+- 流模式的连续读取:监视目录中出现的新文件
-**Bounded read example**:
+**有界读取示例**:
-In this example we create a DataStream containing the lines of a text file as Strings.
-There is no need for a watermark strategy as records do not contain event timestamps.
+在此示例中,我们创建了一个 DataStream,其中包含作为字符串的文本文件的行。
+此处不需要水印策略,因为记录不包含事件时间戳。
```java
final FileSource<String> source =
@@ -57,10 +57,9 @@ final DataStream<String> stream =
env.fromSource(source, WatermarkStrategy.noWatermarks(), "file-source");
```
-**Continuous read example**:
-In this example, we create a DataStream containing the lines of text files as Strings that will infinitely grow
-as new files are added to the directory. We monitor for new files each second.
-There is no need for a watermark strategy as records do not contain event timestamps.
+**连续读取示例**:
+在此示例中,我们创建了一个 DataStream,随着新文件被添加到目录中,其中包含的文本文件行的字符串流将无限增长。我们每秒会进行新文件监控。
+此处不需要水印策略,因为记录不包含事件时间戳。
```java
final FileSource<String> source =