Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
58320e8a
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
58320e8a
编写于
9月 15, 2017
作者:
Z
zhangminglei
提交者:
Tzu-Li (Gordon) Tai
9月 26, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-4047] [docs] Fix documentation about determinism of KeySelectors
This closes #4659.
上级
b0548418
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
5 deletion
+6
-5
docs/dev/api_concepts.md
docs/dev/api_concepts.md
+1
-1
flink-core/src/main/java/org/apache/flink/api/java/functions/KeySelector.java
...java/org/apache/flink/api/java/functions/KeySelector.java
+5
-4
未找到文件。
docs/dev/api_concepts.md
浏览文件 @
58320e8a
...
...
@@ -450,7 +450,7 @@ These are valid field expressions for the example code above:
{:.no_toc}
An additional way to define keys are "key selector" functions. A key selector function
takes a single element as input and returns the key for the element. The key can be of any type and be derived from
arbitrary
computations.
takes a single element as input and returns the key for the element. The key can be of any type and be derived from
deterministic
computations.
The following example shows a key selector function that simply returns the field of an object:
...
...
flink-core/src/main/java/org/apache/flink/api/java/functions/KeySelector.java
浏览文件 @
58320e8a
...
...
@@ -24,10 +24,11 @@ import org.apache.flink.api.common.functions.Function;
import
java.io.Serializable
;
/**
* The {@link KeySelector} allows to use arbitrary objects for operations such as
* reduce, reduceGroup, join, coGoup, etc.
* The {@link KeySelector} allows to use deterministic objects for operations such as
* reduce, reduceGroup, join, coGoup, etc. If invoked multiple times on the same object,
* the returned key must be the same.
*
* The extractor takes an object and returns the key for that object.
* The extractor takes an object and returns the
deterministic
key for that object.
*
* @param <IN> Type of objects to extract the key from.
* @param <KEY> Type of key.
...
...
@@ -36,7 +37,7 @@ import java.io.Serializable;
public
interface
KeySelector
<
IN
,
KEY
>
extends
Function
,
Serializable
{
/**
* User-defined function that
extracts the key from an arbitrary
object.
* User-defined function that
deterministically extracts the key from an
object.
*
* For example for a class:
* <pre>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录