Package com.asakusafw.compiler.flow.plan

Examples of com.asakusafw.compiler.flow.plan.StageGraph


     * @throws IllegalArgumentException 引数に{@code null}が指定された場合
     */
    public JobflowModel compile(FlowGraph graph) throws IOException {
        Precondition.checkMustNotBeNull(graph, "graph"); //$NON-NLS-1$
        validate(graph);
        StageGraph stageGraph = plan(graph);
        visualize(graph, stageGraph);
        List<StageModel> stages = compileStages(stageGraph);
        JobflowModel jobflow = compileJobflow(stageGraph, stages);
        addApplicationInfo();
        return jobflow;
View Full Code Here


    private StageGraph plan(FlowGraph flowGraph) throws IOException {
        assert flowGraph != null;
        StagePlanner planner = new StagePlanner(
                configuration.getGraphRewriters().getRewriters(),
                configuration.getOptions());
        StageGraph plan = planner.plan(flowGraph);
        if (plan == null) {
            for (Diagnostic diagnostic : planner.getDiagnostics()) {
                LOG.error(diagnostic.toString());
            }
            throw new IOException("実行計画の作成に失敗しました");
View Full Code Here

    }

    private void processDescription(JobFlowWorkDescription desc, JobflowModel model) throws IOException {
        assert desc != null;
        assert model != null;
        StageGraph stageGraph = model.getStageGraph();
        processFlowGraph(model.getFlowId(), stageGraph.getInput().getSource().getOrigin());
        processStageGraph(model.getFlowId(), stageGraph);
        for (StageBlock stage : stageGraph.getStages()) {
            processStageBlock(model.getFlowId(), stage);
        }
    }
View Full Code Here

     * @param aClass ジョブフロー記述クラス
     * @return ステージグラフ
     */
    protected List<StageModel> compile(Class<? extends FlowDescription> aClass) {
        assert aClass != null;
        StageGraph graph = jfToStageGraph(aClass);
        return compileStages(graph);
    }
View Full Code Here

    private StageGraph flowToStageGraph(FlowGraph flowGraph) {
        assert flowGraph != null;
        StagePlanner planner = new StagePlanner(
                environment.getGraphRewriters().getRewriters(),
                environment.getOptions());
        StageGraph planned = planner.plan(flowGraph);
        assertThat(planner.getDiagnostics().toString(),
                planner.getDiagnostics().isEmpty(),
                is(true));
        return planned;
    }
View Full Code Here

    /**
     * Part to Ex1 (invalid).
     */
    @Test
    public void Part_Ex1() {
        StageGraph graph = jfToStageGraph(ProjectFlowInvalid.class);
        try {
            new StageCompiler(environment).compile(graph);
            assertThat(environment.hasError(), is(true));
        } catch (IOException e) {
            // ok
View Full Code Here

        assertThat(results.size(), is(1));
        assertThat(results.get(0).getValueOption().get(), is(100));
    }

    private StageModel mr(Class<? extends FlowDescription> aClass) throws IOException {
        StageGraph graph = jfToStageGraph(aClass);
        assertThat(graph.getStages().size(), is(1));
        StageBlock target = graph.getStages().get(0);
        StageAnalyzer analyzer = new StageAnalyzer(environment);
        StageModel analyzed = analyzer.analyze(target, compileShuffle(target));
        return analyzed;
    }
View Full Code Here

        assertThat(cmp.compare(k1, k2), lessThan(0));
        assertThat(cmp.compare(k2, k1), greaterThan(0));
    }

    private ShuffleModel shuffle(Class<? extends FlowDescription> aClass) {
        StageGraph graph = jfToStageGraph(aClass);
        assertThat(graph.getStages().size(), is(1));
        StageBlock target = graph.getStages().get(0);
        ShuffleAnalyzer analyzer = new ShuffleAnalyzer(environment);
        ShuffleModel analyzed = analyzer.analyze(target);
        return analyzed;
    }
View Full Code Here

        setShuffleKey(seg2, k2, ex2);
        assertThat(cmp.compare(k1, k2), not(0));
    }

    private ShuffleModel shuffle(Class<? extends FlowDescription> aClass) {
        StageGraph graph = jfToStageGraph(aClass);
        assertThat(graph.getStages().size(), is(1));
        StageBlock target = graph.getStages().get(0);
        ShuffleAnalyzer analyzer = new ShuffleAnalyzer(environment);
        ShuffleModel analyzed = analyzer.analyze(target);
        return analyzed;
    }
View Full Code Here

                term.getTermId());
        return access(key, fieldName);
    }

    private ShuffleModel shuffle(Class<? extends FlowDescription> aClass) {
        StageGraph graph = jfToStageGraph(aClass);
        assertThat(graph.getStages().size(), is(1));
        StageBlock target = graph.getStages().get(0);
        ShuffleAnalyzer analyzer = new ShuffleAnalyzer(environment);
        ShuffleModel analyzed = analyzer.analyze(target);
        assertThat(environment.hasError(), is(false));
        return analyzed;
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.plan.StageGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.