Search in sources :

Example 6 with PreviewPlanEnvironment

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

the class PreviewPlanDumpTest method dumpWebLogAnalysis.

@Test
public void dumpWebLogAnalysis() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        org.apache.flink.examples.java.relational.WebLogAnalysis.main(new String[] { "--documents", IN_FILE, "--ranks", IN_FILE, "--visits", OUT_FILE, "--output", "123" });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("WebLogAnalysis 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)

Example 7 with PreviewPlanEnvironment

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

the class ConnectedComponentsCoGroupTest method getConnectedComponentsCoGroupPlan.

public static Plan getConnectedComponentsCoGroupPlan() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        ConnectedComponentsWithCoGroup(new String[] { DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE, "100" });
    } catch (ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("ConnectedComponentsWithCoGroup failed with an exception");
    }
    return env.getPlan();
}
Also used : ProgramAbortException(org.apache.flink.client.program.OptimizerPlanEnvironment.ProgramAbortException) PreviewPlanEnvironment(org.apache.flink.client.program.PreviewPlanEnvironment) ProgramAbortException(org.apache.flink.client.program.OptimizerPlanEnvironment.ProgramAbortException)

Example 8 with PreviewPlanEnvironment

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

the class KMeansSingleStepTest method getKMeansPlan.

public static Plan getKMeansPlan() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        KMeans(new String[] { IN_FILE, IN_FILE, OUT_FILE, "20" });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("KMeans failed with an exception");
    }
    return env.getPlan();
}
Also used : OptimizerPlanEnvironment(org.apache.flink.client.program.OptimizerPlanEnvironment) PreviewPlanEnvironment(org.apache.flink.client.program.PreviewPlanEnvironment)

Example 9 with PreviewPlanEnvironment

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

the class RelationalQueryCompilerTest method getTPCH3Plan.

public static Plan getTPCH3Plan() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        TCPH3(new String[] { DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("TCPH3 failed with an exception");
    }
    return env.getPlan();
}
Also used : OptimizerPlanEnvironment(org.apache.flink.client.program.OptimizerPlanEnvironment) PreviewPlanEnvironment(org.apache.flink.client.program.PreviewPlanEnvironment)

Example 10 with PreviewPlanEnvironment

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

the class PreviewPlanDumpTest method dumpTPCH3.

@Test
public void dumpTPCH3() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        TPCHQuery3.main(new String[] { "--lineitem", IN_FILE, "--customer", IN_FILE, "--orders", OUT_FILE, "--output", "123" });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("TPCH3 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