Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.HadoopScriptHandler


    @Test
    public void cleanup() throws Exception {
        String target = new File(getAsakusaHome(), ProcessHadoopScriptHandler.PATH_EXECUTE).getAbsolutePath();
        File shell = putScript("arguments.sh", new File(target));

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                ProcessHadoopScriptHandler.KEY_CLEANUP, "true");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.CLEANUP, map());

        handler.cleanUp(ExecutionMonitor.NULL, context);

        List<String> results = getOutput(shell);
        assertThat(results.subList(0, 5), is(Arrays.asList(
                ProcessHadoopScriptHandler.CLEANUP_STAGE_CLASS,
                "tbatch",
View Full Code Here


    @Test
    public void cleanup_skip() throws Exception {
        String target = new File(getAsakusaHome(), ProcessHadoopScriptHandler.PATH_EXECUTE).getAbsolutePath();
        File shell = putScript("arguments.sh", new File(target));

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                ProcessHadoopScriptHandler.KEY_CLEANUP, "false");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.CLEANUP, map());

        handler.cleanUp(ExecutionMonitor.NULL, context);

        try {
            getOutput(shell);
            fail();
        } catch (IOException e) {
View Full Code Here

    @Test
    public void cleanup_obsolete_profiles() throws Exception {
        String target = new File(getAsakusaHome(), ProcessHadoopScriptHandler.PATH_EXECUTE).getAbsolutePath();
        File shell = putScript("arguments.sh", new File(target));

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                ProcessHadoopScriptHandler.KEY_CLEANUP, "true",
                ProcessHadoopScriptHandler.KEY_WORKING_DIRECTORY, "OBSOLETE",
                ProcessUtil.PREFIX_CLEANUP + "1", "OBSOLETE");

        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.CLEANUP, map());

        handler.cleanUp(ExecutionMonitor.NULL, context);

        List<String> results = getOutput(shell);
        assertThat(results.subList(0, 5), is(Arrays.asList(
                ProcessHadoopScriptHandler.CLEANUP_STAGE_CLASS,
                "tbatch",
View Full Code Here

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

        HadoopScriptHandler handler = handler("env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath());
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map("hello", "world", "key", "value"));
        execute(context, script, handler);

        List<String> results = getOutput(shell);
View Full Code Here

                set(),
                "com.example.Client",
                map("hello", "world", "hoge", "foo"),
                map());

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "prop.hello", "handler",
                "prop.bar", "moga");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map());
View Full Code Here

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

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "command.0", "@[0]",
                "command.1", "@[2]-@[3]-@[4]");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map("hello", "world", "key", "value"));
View Full Code Here

                set(),
                "com.example.Client",
                map(),
                map("script", "SCRIPT", "override", "SCRIPT"));

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "env.handler", "HANDLER",
                "env.override", "HANDLER");
        execute(script, handler);
View Full Code Here

                set(),
                "com.example.Client",
                map(),
                map("script", "SCRIPT", "override", "SCRIPT"));

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "env.handler", "HANDLER",
                "env.override", "HANDLER");

        RuntimeContext rc = RuntimeContext.DEFAULT
View Full Code Here

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

        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

                set(),
                "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

TOP

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

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.