Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.RunningJob


        conf.setOutputFormat(TextOutputFormat.class);

        FileInputFormat.setInputPaths(conf, new Path(input));
        FileOutputFormat.setOutputPath(conf, new Path(output));

        RunningJob job = JobClient.runJob(conf);
        while (!job.isComplete()) {
            job.waitForCompletion();
        }
    }
View Full Code Here


        conf.setOutputFormat(TextOutputFormat.class);

        FileInputFormat.setInputPaths(conf, new Path(input));
        FileOutputFormat.setOutputPath(conf, new Path(output));

        RunningJob job = JobClient.runJob(conf);
        while (!job.isComplete()) {
            job.waitForCompletion();
        }
    }
View Full Code Here

        conf.setOutputFormat(TextOutputFormat.class);

        FileInputFormat.setInputPaths(conf, new Path(input));
        FileOutputFormat.setOutputPath(conf, new Path(output));

        RunningJob job = JobClient.runJob(conf);
        while (!job.isComplete()) {
            job.waitForCompletion();
        }
    }
View Full Code Here

        conf.setOutputFormat(TextOutputFormat.class);

        FileInputFormat.setInputPaths(conf, new Path(input));
        FileOutputFormat.setOutputPath(conf, new Path(output));

        RunningJob job = JobClient.runJob(conf);
        while (!job.isComplete()) {
            job.waitForCompletion();
        }
    }
View Full Code Here

        conf.setOutputFormat(TextOutputFormat.class);

        FileInputFormat.setInputPaths(conf, new Path(input1), new Path(input2));
        FileOutputFormat.setOutputPath(conf, new Path(output));
       
        RunningJob job = JobClient.runJob(conf);
        while (!job.isComplete()) {
            job.waitForCompletion();
        }
    }
View Full Code Here

        originalStatus = JobStatus.fromRunState(value + 1);
      }
    } catch (Exception ignore) {}

    // go for the running info if available
    RunningJob runningJob = getRunningJob(job);
    if (runningJob != null) {
      try {
        return JobStatus.fromRunState(runningJob.getJobState());
      } catch (IOException ex) {
        return JobStatus.UNKNOWN;
      }
    }
View Full Code Here

      jobConf.setInt("mapred.map.tasks", 1);
      jobConf.setInt("mapred.map.max.attempts", 1);
      jobConf.setInt("mapred.reduce.max.attempts", 1);
      jobConf.set("mapred.input.dir", inputDir.toString());
      jobConf.set("mapred.output.dir", outputDir.toString());
      final RunningJob runningJob = jobClient.submitJob(jobConf);
      waitFor(60 * 1000, true, new Predicate() {
        @Override
        public boolean evaluate() throws Exception {
          return runningJob.isComplete();
        }
      });
      Assert.assertTrue(runningJob.isSuccessful());
      Assert.assertTrue(fs.exists(new Path(outputDir, "part-00000")));
      BufferedReader reader =
        new BufferedReader(new InputStreamReader(fs.open(new Path(outputDir, "part-00000"))));
      Assert.assertTrue(reader.readLine().trim().endsWith("a"));
      Assert.assertTrue(reader.readLine().trim().endsWith("b"));
View Full Code Here

   * @return job handle
   * @throws Exception
   */
  public RunningJob submitAndVerifyJob(Configuration conf) throws Exception {
    JobConf jconf = new JobConf(conf);
    RunningJob rJob = getClient().submitJob(jconf);
    JobID jobId = rJob.getID();
    verifyRunningJob(jobId);
    verifyCompletedJob(jobId);
    return rJob;
  }
View Full Code Here

   *
   * @param id id of the job to be verified.
   */
 
  public void verifyCompletedJob(JobID id) throws Exception{
    RunningJob rJob = getClient().getJob(
        org.apache.hadoop.mapred.JobID.downgrade(id));
    while(!rJob.isComplete()) {
      LOG.info("waiting for job :" + id + " to retire");
      Thread.sleep(1000);
      rJob = getClient().getJob(
          org.apache.hadoop.mapred.JobID.downgrade(id));
    }
View Full Code Here

      conf.set(propertyKey, properties.get(propertyKey));

    configJob(conf);

    JobClient c = new JobClient(conf);
    RunningJob job = c.runJob(conf);
    return job.isSuccessful();
  }
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.