Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ExecutionContext


        HadoopScriptHandler handler = handler(
                JschProcessExecutor.KEY_USER, System.getProperty("user.name"),
                JschProcessExecutor.KEY_HOST, "localhost",
                JschProcessExecutor.KEY_PRIVATE_KEY, privateKey.getAbsolutePath());
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map());
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here


                "com.example.Client",
                map(),
                map());

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

                "com.example.Client",
                map(),
                map());

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

                map());

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "command.0", "@[999]");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map());
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

                exporters,
                finalizers);
    }

    private List<TestExecutionPlan.Job> resolveJobs(FlowScript flow, ExecutionPhase phase) throws IOException {
        ExecutionContext context = createExecutionContext(flow, phase);
        List<TestExecutionPlan.Job> results = new ArrayList<TestExecutionPlan.Job>();
        for (ExecutionScript script : flow.getScripts().get(phase)) {
            HadoopScript resolved = (HadoopScript) resolveScript(script, context);
            Map<String, String> props = new TreeMap<String, String>();
            props.putAll(getHadoopProperties());
            props.putAll(resolved.getHadoopProperties());
            results.add(new TestExecutionPlan.Job(
                    resolved.getClassName(),
                    context.getExecutionId(),
                    props));
        }
        return results;
    }
View Full Code Here

        }
        return results;
    }

    private List<TestExecutionPlan.Command> resolveCommands(FlowScript flow, ExecutionPhase phase) throws IOException {
        ExecutionContext context = createExecutionContext(flow, phase);
        List<TestExecutionPlan.Command> results = new ArrayList<TestExecutionPlan.Command>();
        for (ExecutionScript script : flow.getScripts().get(phase)) {
            CommandScript resolved = (CommandScript) resolveScript(script, context);
            results.add(new TestExecutionPlan.Command(
                    resolved.getCommandLineTokens(),
View Full Code Here

        dPropMap.putAll(context.getExtraConfigurations());
        return dPropMap;
    }

    private ExecutionContext createExecutionContext(FlowScript flow, ExecutionPhase phase) {
        return new ExecutionContext(
                configuration.script.getId(),
                flow.getId(),
                getExecutionId(flow),
                phase,
                configuration.context.getBatchArgs(),
View Full Code Here

        Map<String, String> conf = createConf();
        declare(conf, "default", MockCommandScriptHandler.class);
        declare(conf, "other", MockCommandScriptHandler.class);
        CommandScriptHandlerDispatcher dispatcher = create(conf);

        ExecutionContext something = context("something");
        assertThat(dispatcher.getResourceId(something, null), is("default"));

        ExecutionContext testing = context("testing");
        assertThat(dispatcher.getResourceId(testing, null), is("other"));
    }
View Full Code Here

        Map<String, String> conf = createConf();
        declare(conf, "default", MockCommandScriptHandler.class);
        declare(conf, "other", MockCommandScriptHandler.class);
        CommandScriptHandlerDispatcher dispatcher = create(conf);

        ExecutionContext something = context("something");
        assertThat(dispatcher.getProperties(something, null).get("value"), is("default"));

        ExecutionContext testing = context("testing");
        assertThat(dispatcher.getProperties(testing, null).get("value"), is("other"));
    }
View Full Code Here

        Map<String, String> conf = createConf();
        declare(conf, "default", MockCommandScriptHandler.class);
        declare(conf, "other", MockCommandScriptHandler.class);
        CommandScriptHandlerDispatcher dispatcher = create(conf);

        ExecutionContext something = context("something");
        assertThat(dispatcher.getEnvironmentVariables(something, null).get("value"), is("default"));

        ExecutionContext testing = context("testing");
        assertThat(dispatcher.getEnvironmentVariables(testing, null).get("value"), is("other"));
    }
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.