Search in sources :

Example 11 with PreviewPlanEnvironment

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

the class PreviewPlanDumpTest method dumpPageRank.

@Test
public void dumpPageRank() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        // --pages <path> --links <path> --output <path> --numPages <n> --iterations <n>
        PageRank.main(new String[] { "--pages", IN_FILE, "--links", IN_FILE, "--output", OUT_FILE, "--numPages", "10", "--iterations", "123" });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("PageRank 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 12 with PreviewPlanEnvironment

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

the class DumpCompiledPlanTest 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)

Example 13 with PreviewPlanEnvironment

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

the class DumpCompiledPlanTest method dumpPageRank.

@Test
public void dumpPageRank() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        PageRank.main(new String[] { "--pages", IN_FILE, "--links", IN_FILE, "--output", OUT_FILE, "--numPages", "10", "--iterations", "123" });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("PageRank 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 14 with PreviewPlanEnvironment

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

the class DumpCompiledPlanTest method dumpBulkIterationKMeans.

@Test
public void dumpBulkIterationKMeans() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        ConnectedComponents.main(new String[] { "--vertices", IN_FILE, "--edges", IN_FILE, "--output", OUT_FILE, "--iterations", "123" });
    } catch (OptimizerPlanEnvironment.ProgramAbortException pae) {
    // all good.
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("ConnectedComponents 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 15 with PreviewPlanEnvironment

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

the class DumpCompiledPlanTest method dumpWebLogAnalysis.

@Test
public void dumpWebLogAnalysis() {
    // prepare the test environment
    PreviewPlanEnvironment env = new PreviewPlanEnvironment();
    env.setAsContext();
    try {
        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)

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