Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content.zh/docs/dev/datastream/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Data Sources
{{< tabs "8104e62c-db79-40b0-8519-0063e9be791f" >}}
{{< tab "Java" >}}

Source 是你的程序从中读取其输入的地方。你可以用 `StreamExecutionEnvironment.addSource(sourceFunction)` 将一个 source 关联到你的程序。Flink 自带了许多预先实现的 source functions,不过你仍然可以通过实现 `SourceFunction` 接口编写自定义的非并行 source,也可以通过实现 `ParallelSourceFunction` 接口或者继承 `RichParallelSourceFunction` 类编写自定义的并行 sources。
Source 是你的程序从中读取其输入的地方。你可以用 `StreamExecutionEnvironment.addSource(sourceFunction)` 将一个 source 关联到你的程序。Flink 自带了许多预先实现的 source functions,不过你仍然可以通过实现 {{< gh_link file="flink-runtime/src/main/java/org/apache/flink/streaming/api/functions/source/legacy/SourceFunction.java" name="SourceFunction" >}} 接口编写自定义的非并行 source,也可以通过实现 {{< gh_link file="flink-runtime/src/main/java/org/apache/flink/streaming/api/functions/source/legacy/ParallelSourceFunction.java" name="ParallelSourceFunction" >}} 接口或者继承 {{< gh_link file="flink-runtime/src/main/java/org/apache/flink/streaming/api/functions/source/legacy/RichParallelSourceFunction.java" name="RichParallelSourceFunction" >}} 类编写自定义的并行 sources。

通过 `StreamExecutionEnvironment` 可以访问多种预定义的 stream source:

Expand Down
10 changes: 7 additions & 3 deletions docs/content/docs/dev/datastream/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,13 @@ Data Sources

Sources are where your program reads its input from. You can attach a source to your program by
using `StreamExecutionEnvironment.addSource(sourceFunction)`. Flink comes with a number of pre-implemented
source functions, but you can always write your own custom sources by implementing the `SourceFunction`
for non-parallel sources, or by implementing the `ParallelSourceFunction` interface or extending the
`RichParallelSourceFunction` for parallel sources.
source functions, but you can always write your own custom sources by implementing the
{{< gh_link file="flink-runtime/src/main/java/org/apache/flink/streaming/api/functions/source/legacy/SourceFunction.java" name="SourceFunction" >}}
interface for non-parallel sources, or by implementing the
{{< gh_link file="flink-runtime/src/main/java/org/apache/flink/streaming/api/functions/source/legacy/ParallelSourceFunction.java" name="ParallelSourceFunction" >}}
interface or extending the
{{< gh_link file="flink-runtime/src/main/java/org/apache/flink/streaming/api/functions/source/legacy/RichParallelSourceFunction.java" name="RichParallelSourceFunction" >}}
class for parallel sources.

There are several predefined stream sources accessible from the `StreamExecutionEnvironment`:

Expand Down