本文整理汇总了Java中org.apache.flink.api.java.ExecutionEnvironment.getExecutionPlan方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEnvironment.getExecutionPlan方法的具体用法?Java ExecutionEnvironment.getExecutionPlan怎么用?Java ExecutionEnvironment.getExecutionPlan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.api.java.ExecutionEnvironment
的用法示例。
在下文中一共展示了ExecutionEnvironment.getExecutionPlan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testExecuteAfterGetExecutionPlan
import org.apache.flink.api.java.ExecutionEnvironment; //导入方法依赖的package包/类
@Test
public void testExecuteAfterGetExecutionPlan() {
ExecutionEnvironment env = new LocalEnvironment();
env.getConfig().disableSysoutLogging();
DataSet<Integer> baseSet = env.fromElements(1, 2);
DataSet<Integer> result = baseSet.map(new MapFunction<Integer, Integer>() {
@Override public Integer map(Integer value) throws Exception {
return value * 2;
}});
result.output(new DiscardingOutputFormat<Integer>());
try {
env.getExecutionPlan();
env.execute();
}
catch (Exception e) {
e.printStackTrace();
fail("Cannot run both #getExecutionPlan and #execute.");
}
}
示例2: testCreatePlanAfterGetExecutionPlan
import org.apache.flink.api.java.ExecutionEnvironment; //导入方法依赖的package包/类
@Test
public void testCreatePlanAfterGetExecutionPlan() {
ExecutionEnvironment env = new LocalEnvironment();
DataSet<Integer> baseSet = env.fromElements(1, 2);
DataSet<Integer> result = baseSet.map(new MapFunction<Integer, Integer>() {
@Override public Integer map(Integer value) throws Exception {
return value * 2;
}});
result.output(new DiscardingOutputFormat<Integer>());
try {
env.getExecutionPlan();
env.createProgramPlan();
} catch (Exception e) {
e.printStackTrace();
fail("Cannot run both #getExecutionPlan and #execute. Message: " + e.getMessage());
}
}
示例3: testGetExecutionPlanOfRangePartition
import org.apache.flink.api.java.ExecutionEnvironment; //导入方法依赖的package包/类
@Test
public void testGetExecutionPlanOfRangePartition() {
ExecutionEnvironment env = new LocalEnvironment();
env.getConfig().disableSysoutLogging();
DataSet<Integer> baseSet = env.fromElements(1, 2);
DataSet<Tuple2<Integer, Integer>> result = baseSet
.map(new MapFunction<Integer, Tuple2<Integer, Integer>>() {
@Override
public Tuple2<Integer, Integer> map(Integer value) throws Exception {
return new Tuple2(value, value * 2);
}
})
.partitionByRange(0)
.aggregate(Aggregations.MAX, 1);
result.output(new DiscardingOutputFormat<Tuple2<Integer, Integer>>());
try {
env.getExecutionPlan();
env.execute();
}
catch (Exception e) {
e.printStackTrace();
fail("Cannot run both #getExecutionPlan and #execute.");
}
}