use of org.apache.flink.client.program.PackagedProgram in project flink by apache.
the class DumpCompiledPlanTest method verifyOptimizedPlan.
private void verifyOptimizedPlan(Class<?> entrypoint, String... args) throws Exception {
final PackagedProgram program = PackagedProgram.newBuilder().setEntryPointClassName(entrypoint.getName()).setArguments(args).build();
final Pipeline pipeline = PackagedProgramUtils.getPipelineFromProgram(program, new Configuration(), 1, true);
assertTrue(pipeline instanceof Plan);
final Plan plan = (Plan) pipeline;
final OptimizedPlan op = compileNoStats(plan);
final PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator();
final String json = dumper.getOptimizerPlanAsJSON(op);
try (JsonParser parser = new JsonFactory().createParser(json)) {
while (parser.nextToken() != null) {
}
}
}
use of org.apache.flink.client.program.PackagedProgram in project flink by apache.
the class PreviewPlanDumpTest method verifyPlanDump.
private static void verifyPlanDump(Class<?> entrypoint, String... args) throws Exception {
final PackagedProgram program = PackagedProgram.newBuilder().setEntryPointClassName(entrypoint.getName()).setArguments(args).build();
final Pipeline pipeline = PackagedProgramUtils.getPipelineFromProgram(program, new Configuration(), 1, true);
assertTrue(pipeline instanceof Plan);
final Plan plan = (Plan) pipeline;
final List<DataSinkNode> sinks = Optimizer.createPreOptimizedPlan(plan);
final PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator();
final String json = dumper.getPactPlanAsJSON(sinks);
try (JsonParser parser = new JsonFactory().createParser(json)) {
while (parser.nextToken() != null) {
}
}
}
Aggregations