Search in sources :

Example 16 with PreviewPlanEnvironment

use of org.apache.flink.client.program.PreviewPlanEnvironment in project flink by apache.

the class DumpCompiledPlanTest method dumpWordCount.

@Test
public void dumpWordCount() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        WordCount.main(new String[] { "--input", IN_FILE, "--output", OUT_FILE });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("WordCount failed with an exception");
    }
    dump(env.getPlan());
}
Also used : OptimizerPlanEnvironment(org.apache.flink.client.program.OptimizerPlanEnvironment) PreviewPlanEnvironment(org.apache.flink.client.program.PreviewPlanEnvironment) JsonParseException(org.codehaus.jackson.JsonParseException) Test(org.junit.Test)

Aggregations

PreviewPlanEnvironment (org.apache.flink.client.program.PreviewPlanEnvironment)16 OptimizerPlanEnvironment (org.apache.flink.client.program.OptimizerPlanEnvironment)15 JsonParseException (org.codehaus.jackson.JsonParseException)12 Test (org.junit.Test)12 ProgramAbortException (org.apache.flink.client.program.OptimizerPlanEnvironment.ProgramAbortException)1 StreamGraph (org.apache.flink.streaming.api.graph.StreamGraph)1