本文整理汇总了Java中org.apache.flink.api.common.functions.RichJoinFunction类的典型用法代码示例。如果您正苦于以下问题:Java RichJoinFunction类的具体用法?Java RichJoinFunction怎么用?Java RichJoinFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RichJoinFunction类属于org.apache.flink.api.common.functions包,在下文中一共展示了RichJoinFunction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testBranchingBroadcastVariable
import org.apache.flink.api.common.functions.RichJoinFunction; //导入依赖的package包/类
@Test
public void testBranchingBroadcastVariable() {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(100);
DataSet<String> input1 = env.readTextFile(IN_FILE).name("source1");
DataSet<String> input2 = env.readTextFile(IN_FILE).name("source2");
DataSet<String> input3 = env.readTextFile(IN_FILE).name("source3");
DataSet<String> result1 = input1
.map(new IdentityMapper<String>())
.reduceGroup(new Top1GroupReducer<String>())
.withBroadcastSet(input3, "bc");
DataSet<String> result2 = input2
.map(new IdentityMapper<String>())
.reduceGroup(new Top1GroupReducer<String>())
.withBroadcastSet(input3, "bc");
result1.join(result2)
.where(new IdentityKeyExtractor<String>())
.equalTo(new IdentityKeyExtractor<String>())
.with(new RichJoinFunction<String, String, String>() {
@Override
public String join(String first, String second) {
return null;
}
})
.withBroadcastSet(input3, "bc1")
.withBroadcastSet(input1, "bc2")
.withBroadcastSet(result1, "bc3")
.output(new DiscardingOutputFormat<String>());
Plan plan = env.createProgramPlan();
try{
compileNoStats(plan);
}catch(Exception e){
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
开发者ID:axbaretto,项目名称:flink,代码行数:43,代码来源:BranchingPlansCompilerTest.java
示例2: testBranchingBroadcastVariable
import org.apache.flink.api.common.functions.RichJoinFunction; //导入依赖的package包/类
@Test
public void testBranchingBroadcastVariable() {
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<String> input1 = env.readTextFile(IN_FILE).name("source1");
DataSet<String> input2 = env.readTextFile(IN_FILE).name("source2");
DataSet<String> input3 = env.readTextFile(IN_FILE).name("source3");
DataSet<String> result1 = input1
.map(new IdentityMapper<String>())
.reduceGroup(new Top1GroupReducer<String>())
.withBroadcastSet(input3, "bc");
DataSet<String> result2 = input2
.map(new IdentityMapper<String>())
.reduceGroup(new Top1GroupReducer<String>())
.withBroadcastSet(input3, "bc");
result1.join(result2)
.where(new IdentityKeyExtractor<String>())
.equalTo(new IdentityKeyExtractor<String>())
.with(new RichJoinFunction<String, String, String>() {
@Override
public String join(String first, String second) {
return null;
}
})
.withBroadcastSet(input3, "bc1")
.withBroadcastSet(input1, "bc2")
.withBroadcastSet(result1, "bc3")
.print();
Plan plan = env.createProgramPlan();
try{
compileNoStats(plan);
}catch(Exception e){
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:42,代码来源:BranchingPlansCompilerTest.java
注:本文中的org.apache.flink.api.common.functions.RichJoinFunction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论