本文整理了Java中org.apache.flink.api.java.operators.MapOperator.count()
方法的一些代码示例,展示了MapOperator.count()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MapOperator.count()
方法的具体详情如下:
包路径:org.apache.flink.api.java.operators.MapOperator
类名称:MapOperator
方法名:count
暂无
代码示例来源:origin: apache/flink
/**
* Checks that the edge set input contains valid vertex Ids, i.e. that they
* also exist in the vertex input set.
*
* @return a boolean stating whether a graph is valid
* with respect to its vertex ids.
*/
@Override
public boolean validate(Graph<K, VV, EV> graph) throws Exception {
DataSet<Tuple1<K>> edgeIds = graph.getEdges()
.flatMap(new MapEdgeIds<>()).distinct();
DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)
.equalTo(0).with(new GroupInvalidIds<>()).first(1);
return invalidIds.map(new KToTupleMap<>()).count() == 0;
}
代码示例来源:origin: amidst/toolbox
public static void main(String[] args) throws Exception {
//BasicConfigurator.configure();
//PropertyConfigurator.configure(args[0]);
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
logger.info("Entering application.");
DataSet<String> text = env.fromElements(
"Who's there?",
"I think I hear them. Stand, ho! Who's there?");
List<Integer> elements = new ArrayList<Integer>();
elements.add(0);
DataSet<TestClass> set = env.fromElements(new TestClass(elements));
DataSet<Tuple2<String, Integer>> wordCounts = text
.flatMap(new LineSplitter())
.withBroadcastSet(set, "set")
.groupBy(0)
.sum(1);
//wordCounts.writeAsText("output.txt", FileSystem.WriteMode.OVERWRITE);
wordCounts.map(new PrintTuple()).count();
}
代码示例来源:origin: org.apache.flink/flink-gelly_2.11
/**
* Checks that the edge set input contains valid vertex Ids, i.e. that they
* also exist in the vertex input set.
*
* @return a boolean stating whether a graph is valid
* with respect to its vertex ids.
*/
@Override
public boolean validate(Graph<K, VV, EV> graph) throws Exception {
DataSet<Tuple1<K>> edgeIds = graph.getEdges()
.flatMap(new MapEdgeIds<>()).distinct();
DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)
.equalTo(0).with(new GroupInvalidIds<>()).first(1);
return invalidIds.map(new KToTupleMap<>()).count() == 0;
}
代码示例来源:origin: org.apache.flink/flink-gelly_2.10
/**
* Checks that the edge set input contains valid vertex Ids, i.e. that they
* also exist in the vertex input set.
*
* @return a boolean stating whether a graph is valid
* with respect to its vertex ids.
*/
@Override
public boolean validate(Graph<K, VV, EV> graph) throws Exception {
DataSet<Tuple1<K>> edgeIds = graph.getEdges()
.flatMap(new MapEdgeIds<K, EV>()).distinct();
DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)
.equalTo(0).with(new GroupInvalidIds<K, VV>()).first(1);
return invalidIds.map(new KToTupleMap<K>()).count() == 0;
}
代码示例来源:origin: com.alibaba.blink/flink-gelly
/**
* Checks that the edge set input contains valid vertex Ids, i.e. that they
* also exist in the vertex input set.
*
* @return a boolean stating whether a graph is valid
* with respect to its vertex ids.
*/
@Override
public boolean validate(Graph<K, VV, EV> graph) throws Exception {
DataSet<Tuple1<K>> edgeIds = graph.getEdges()
.flatMap(new MapEdgeIds<>()).distinct();
DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)
.equalTo(0).with(new GroupInvalidIds<>()).first(1);
return invalidIds.map(new KToTupleMap<>()).count() == 0;
}
内容来源于网络,如有侵权,请联系作者删除!