热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.flink.api.java.operators.UnsortedGrouping.getKeys()方法的使用及代码示例

本文整理了Java中org.apache.flink.api.java.operators.UnsortedGrouping.getKeys()方法的一些代码示例,展示了UnsortedGroupin

本文整理了Java中org.apache.flink.api.java.operators.UnsortedGrouping.getKeys()方法的一些代码示例,展示了UnsortedGrouping.getKeys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UnsortedGrouping.getKeys()方法的具体详情如下:
包路径:org.apache.flink.api.java.operators.UnsortedGrouping
类名称:UnsortedGrouping
方法名:getKeys

UnsortedGrouping.getKeys介绍

暂无

代码示例

代码示例来源:origin: apache/flink

/**
* Uses a custom partitioner for the grouping.
*
* @param partitioner The custom partitioner.
* @return The grouping object itself, to allow for method chaining.
*/
public UnsortedGrouping withPartitioner(Partitioner partitioner) {
Preconditions.checkNotNull(partitioner);
getKeys().validateCustomPartitioner(partitioner, null);
this.customPartitiOner= partitioner;
return this;
}

代码示例来源:origin: apache/flink

/**
* Sorts {@link org.apache.flink.api.java.tuple.Tuple} elements within a group on the specified field in the specified {@link Order}.
*
*

Note: Only groups of Tuple elements and Pojos can be sorted.
*
*

Groups can be sorted by multiple fields by chaining {@link #sortGroup(int, Order)} calls.
*
* @param field The Tuple field on which the group is sorted.
* @param order The Order in which the specified Tuple field is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see org.apache.flink.api.java.tuple.Tuple
* @see Order
*/
public SortedGrouping sortGroup(int field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field index group-sorting keys cannot be used together.");
}
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, field, order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: apache/flink

/**
* Sorts Pojos within a group on the specified field in the specified {@link Order}.
*
*

Note: Only groups of Tuple elements and Pojos can be sorted.
*
*

Groups can be sorted by multiple fields by chaining {@link #sortGroup(String, Order)} calls.
*
* @param field The Tuple or Pojo field on which the group is sorted.
* @param order The Order in which the specified field is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see Order
*/
public SortedGrouping sortGroup(String field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field expression group-sorting keys cannot be used together.");
}
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, field, order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: apache/flink

/**
* Sorts elements within a group on a key extracted by the specified {@link org.apache.flink.api.java.functions.KeySelector}
* in the specified {@link Order}.
*
*

Chaining {@link #sortGroup(KeySelector, Order)} calls is not supported.
*
* @param keySelector The KeySelector with which the group is sorted.
* @param order The Order in which the extracted key is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see Order
*/
public SortedGrouping sortGroup(KeySelector keySelector, Order order) {
if (!(this.getKeys() instanceof Keys.SelectorFunctionKeys)) {
throw new InvalidProgramException("KeySelector group-sorting keys can only be used with KeySelector grouping keys.");
}
TypeInformation keyType = TypeExtractor.getKeySelectorTypes(keySelector, this.inputDataSet.getType());
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, new Keys.SelectorFunctionKeys(keySelector, this.inputDataSet.getType(), keyType), order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: com.alibaba.blink/flink-java

/**
* Uses a custom partitioner for the grouping.
*
* @param partitioner The custom partitioner.
* @return The grouping object itself, to allow for method chaining.
*/
public UnsortedGrouping withPartitioner(Partitioner partitioner) {
Preconditions.checkNotNull(partitioner);
getKeys().validateCustomPartitioner(partitioner, null);
this.customPartitiOner= partitioner;
return this;
}

代码示例来源:origin: org.apache.flink/flink-java

/**
* Uses a custom partitioner for the grouping.
*
* @param partitioner The custom partitioner.
* @return The grouping object itself, to allow for method chaining.
*/
public UnsortedGrouping withPartitioner(Partitioner partitioner) {
Preconditions.checkNotNull(partitioner);
getKeys().validateCustomPartitioner(partitioner, null);
this.customPartitiOner= partitioner;
return this;
}

代码示例来源:origin: org.apache.flink/flink-java

/**
* Sorts Pojos within a group on the specified field in the specified {@link Order}.
*
*

Note: Only groups of Tuple elements and Pojos can be sorted.
*
*

Groups can be sorted by multiple fields by chaining {@link #sortGroup(String, Order)} calls.
*
* @param field The Tuple or Pojo field on which the group is sorted.
* @param order The Order in which the specified field is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see Order
*/
public SortedGrouping sortGroup(String field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field expression group-sorting keys cannot be used together.");
}
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, field, order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: com.alibaba.blink/flink-java

/**
* Sorts {@link org.apache.flink.api.java.tuple.Tuple} elements within a group on the specified field in the specified {@link Order}.
*
*

Note: Only groups of Tuple elements and Pojos can be sorted.
*
*

Groups can be sorted by multiple fields by chaining {@link #sortGroup(int, Order)} calls.
*
* @param field The Tuple field on which the group is sorted.
* @param order The Order in which the specified Tuple field is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see org.apache.flink.api.java.tuple.Tuple
* @see Order
*/
public SortedGrouping sortGroup(int field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field index group-sorting keys cannot be used together.");
}
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, field, order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: org.apache.flink/flink-java

/**
* Sorts {@link org.apache.flink.api.java.tuple.Tuple} elements within a group on the specified field in the specified {@link Order}.
*
*

Note: Only groups of Tuple elements and Pojos can be sorted.
*
*

Groups can be sorted by multiple fields by chaining {@link #sortGroup(int, Order)} calls.
*
* @param field The Tuple field on which the group is sorted.
* @param order The Order in which the specified Tuple field is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see org.apache.flink.api.java.tuple.Tuple
* @see Order
*/
public SortedGrouping sortGroup(int field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field index group-sorting keys cannot be used together.");
}
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, field, order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: com.alibaba.blink/flink-java

/**
* Sorts Pojos within a group on the specified field in the specified {@link Order}.
*
*

Note: Only groups of Tuple elements and Pojos can be sorted.
*
*

Groups can be sorted by multiple fields by chaining {@link #sortGroup(String, Order)} calls.
*
* @param field The Tuple or Pojo field on which the group is sorted.
* @param order The Order in which the specified field is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see Order
*/
public SortedGrouping sortGroup(String field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field expression group-sorting keys cannot be used together.");
}
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, field, order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: com.alibaba.blink/flink-java

/**
* Sorts elements within a group on a key extracted by the specified {@link org.apache.flink.api.java.functions.KeySelector}
* in the specified {@link Order}.
*
*

Chaining {@link #sortGroup(KeySelector, Order)} calls is not supported.
*
* @param keySelector The KeySelector with which the group is sorted.
* @param order The Order in which the extracted key is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see Order
*/
public SortedGrouping sortGroup(KeySelector keySelector, Order order) {
if (!(this.getKeys() instanceof Keys.SelectorFunctionKeys)) {
throw new InvalidProgramException("KeySelector group-sorting keys can only be used with KeySelector grouping keys.");
}
TypeInformation keyType = TypeExtractor.getKeySelectorTypes(keySelector, this.inputDataSet.getType());
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, new Keys.SelectorFunctionKeys(keySelector, this.inputDataSet.getType(), keyType), order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

代码示例来源:origin: org.apache.flink/flink-java

/**
* Sorts elements within a group on a key extracted by the specified {@link org.apache.flink.api.java.functions.KeySelector}
* in the specified {@link Order}.
*
*

Chaining {@link #sortGroup(KeySelector, Order)} calls is not supported.
*
* @param keySelector The KeySelector with which the group is sorted.
* @param order The Order in which the extracted key is sorted.
* @return A SortedGrouping with specified order of group element.
*
* @see Order
*/
public SortedGrouping sortGroup(KeySelector keySelector, Order order) {
if (!(this.getKeys() instanceof Keys.SelectorFunctionKeys)) {
throw new InvalidProgramException("KeySelector group-sorting keys can only be used with KeySelector grouping keys.");
}
TypeInformation keyType = TypeExtractor.getKeySelectorTypes(keySelector, this.inputDataSet.getType());
SortedGrouping sg = new SortedGrouping(this.inputDataSet, this.keys, new Keys.SelectorFunctionKeys(keySelector, this.inputDataSet.getType(), keyType), order);
sg.customPartitiOner= getCustomPartitioner();
return sg;
}

推荐阅读
author-avatar
just_roshinn5
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有