Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ExecutionContext


        };
        MockJobClient c2 = new MockJobClient("testing", COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 100, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);

        assertThat(c2.count, is(greaterThan(0)));
    }
View Full Code Here


        MockJobClient c1 = new MockJobClient("testing", COMPLETED);
        MockJobClient c2 = new MockJobClient("testing", COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();

        handler.execute(ExecutionMonitor.NULL, context, script);
        handler.execute(ExecutionMonitor.NULL, context, script);
View Full Code Here

        RuntimeContext rc = RuntimeContext.DEFAULT
            .batchId("b")
            .mode(ExecutionMode.SIMULATION)
            .buildId("OK");
        ExecutionContext context = new ExecutionContext(
                "b", "f", "e", ExecutionPhase.MAIN,
                Collections.<String, String>emptyMap(),
                rc.unapply());

        HadoopScript script = script();
View Full Code Here

    public void cleanup() throws Exception {
        MockJobClient c1 = new MockJobClient("testing", COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        handler.cleanUp(ExecutionMonitor.NULL, context);

        JobScript js = c1.registered.get("testing");
        assertThat(js, is(notNullValue()));
        assertThat(js.getBatchId(), is(context.getBatchId()));
        assertThat(js.getFlowId(), is(context.getFlowId()));
        assertThat(js.getExecutionId(), is(context.getExecutionId()));
        assertThat(js.getPhase(), is(context.getPhase()));
        assertThat(js.getMainClassName(), is(QueueHadoopScriptHandler.CLEANUP_STAGE_CLASS));
        assertThat(js.getArguments(), is(context.getArguments()));

        assertThat(js.getProperties(), hasEntry("s", "service"));
    }
View Full Code Here

    }

    private ExecutionContext context() {
        Map<String, String> args = new HashMap<String, String>();
        args.put("a", "arg");
        return new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, args);
    }
View Full Code Here

            throw new IllegalArgumentException("executionId must not be null"); //$NON-NLS-1$
        }
        if (phase == null) {
            throw new IllegalArgumentException("phase must not be null"); //$NON-NLS-1$
        }
        ExecutionContext context = new ExecutionContext(
                batchId, flowId, executionId, phase, batchArguments, subprocessEnvironmentVaritables);
        executePhase(context);
    }
View Full Code Here

    private void executePhase(
            String batchId,
            FlowScript flow,
            String executionId,
            ExecutionPhase phase) throws InterruptedException, IOException {
        ExecutionContext context = new ExecutionContext(
                batchId, flow.getId(), executionId, phase, batchArguments, subprocessEnvironmentVaritables);
        Set<ExecutionScript> scripts = flow.getScripts().get(phase);
        assert scripts != null;
        executePhase(context, scripts);
    }
View Full Code Here

        RuntimeContext rc = RuntimeContext.DEFAULT
            .batchId("b")
            .mode(ExecutionMode.SIMULATION)
            .buildId("OK");
        ExecutionContext context = new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, map(), rc.unapply());
        execute(context, script, handler);

        Map<String, String> map = new HashMap<String, String>();
        for (String line : getOutput(shell)) {
            if (line.trim().isEmpty()) {
View Full Code Here

                "testing", set(), "profile", "module",
                Arrays.asList(shell.getAbsolutePath(), "Hello, world!"),
                map());

        CommandScriptHandler handler = handler();
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map());
        handler.execute(PhaseMonitor.NULL, context, script);
    }
View Full Code Here

                "testing", set(), "profile", "module",
                Arrays.asList(shell.getAbsolutePath(), "Hello, world!"),
                map());

        CommandScriptHandler handler = handler();
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map());
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.yaess.core.ExecutionContext

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.