Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.RunningJob


    }

    public void testEmpty() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test();
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertTrue(LauncherMapper.isMainSuccessful(runningJob));
        assertFalse(LauncherMapper.hasOutputData(runningJob));
        assertFalse(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here


    }

    public void testExit0() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test("exit0");
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertTrue(LauncherMapper.isMainSuccessful(runningJob));
        assertFalse(LauncherMapper.hasOutputData(runningJob));
        assertFalse(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here

    }

    public void testExit1() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test("exit1");
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertFalse(LauncherMapper.isMainSuccessful(runningJob));
        assertFalse(LauncherMapper.hasOutputData(runningJob));
        assertFalse(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here

    }

    public void testException() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test("ex");
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertFalse(LauncherMapper.isMainSuccessful(runningJob));
        assertFalse(LauncherMapper.hasOutputData(runningJob));
        assertFalse(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here

    }

    public void testOutput() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test("out");
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertTrue(LauncherMapper.isMainSuccessful(runningJob));
        assertTrue(LauncherMapper.hasOutputData(runningJob));
        assertFalse(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here

    }

    public void testNewId() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test("id");
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertTrue(LauncherMapper.isMainSuccessful(runningJob));
        assertFalse(LauncherMapper.hasOutputData(runningJob));
        assertTrue(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here

    }

    public void testSecurityManager() throws Exception {
        Path actionDir = getFsTestCaseDir();
        FileSystem fs = getFileSystem();
        RunningJob runningJob = _test("securityManager");
        Thread.sleep(2000);
        assertTrue(runningJob.isSuccessful());

        assertTrue(LauncherMapper.isMainDone(runningJob));
        assertTrue(LauncherMapper.isMainSuccessful(runningJob));
        assertFalse(LauncherMapper.hasOutputData(runningJob));
        assertFalse(LauncherMapper.hasIdSwap(runningJob));
View Full Code Here

        InputStream is = IOUtils.getResourceAsStream("user-hive-default.xml", -1);
        OutputStream os = fs.create(new Path(getAppPath(), "user-hive-default.xml"));
        IOUtils.copyStream(is, os);

        Context context = createContext(getActionXml());
        final RunningJob launcherJob = submitAction(context);
        String launcherId = context.getAction().getExternalId();
        waitFor(200 * 1000, new Predicate() {
            public boolean evaluate() throws Exception {
                return launcherJob.isComplete();
            }
        });
        assertTrue(launcherJob.isSuccessful());

        assertFalse(LauncherMapper.hasIdSwap(launcherJob));

        HiveActionExecutor ae = new HiveActionExecutor();
        ae.check(context, context.getAction());
View Full Code Here

        JobConf jobConf = Services.get().get(HadoopAccessorService.class).createJobConf(jobTracker);
        XConfiguration.copy(conf, jobConf);
        String user = jobConf.get("user.name");
        String group = jobConf.get("group.name");
        JobClient jobClient = Services.get().get(HadoopAccessorService.class).createJobClient(user, jobConf);
        final RunningJob runningJob = jobClient.getJob(JobID.forName(jobId));
        assertNotNull(runningJob);
        return runningJob;
    }
View Full Code Here

        try {
            if (action.getStatus() == WorkflowAction.Status.OK) {
                Element actionXml = XmlUtils.parseXml(action.getConf());
                JobConf jobConf = createBaseHadoopConf(context, actionXml);
                jobClient = createJobClient(context, jobConf);
                RunningJob runningJob = jobClient.getJob(JobID.forName(action.getExternalId()));
                if (runningJob == null) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "MR002",
                                                      "Unknown hadoop job [{0}] associated with action [{1}].  Failing this action!", action
                            .getExternalId(), action.getId());
                }

                // TODO this has to be done in a better way
                if (!runningJob.getJobName().startsWith("oozie:action:")) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "MR001",
                                                      "ID swap should have happened in launcher job [{0}]", action.getExternalId());
                }

                Counters counters = runningJob.getCounters();
                if (counters != null) {
                    ActionStats stats = new MRStats(counters);
                    String statsJsonString = stats.toJSON();
                    context.setVar(HADOOP_COUNTERS, statsJsonString);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.RunningJob

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.