Class MapReduceUtils


  • public final class MapReduceUtils
    extends Object
    This class contains utility method to easily manipulate the new Hadoop MapReduce API.
    Since:
    1.0
    Author:
    Laurent Jourdren
    • Method Detail

      • submitAndWaitForJob

        public static void submitAndWaitForJob​(org.apache.hadoop.mapreduce.Job job,
                                               String jobDescription,
                                               int waitTimeInMillis,
                                               TaskStatus status,
                                               String counterGroup)
                                        throws EoulsanException
        Wait the completion of a job.
        Parameters:
        job - the job to submit
        jobDescription - the description of the job
        waitTimeInMillis - waiting time between 2 checks of the completion of jobs
        status - step status
        counterGroup - group of the counter to log
        Throws:
        EoulsanException - if the job fail or if an exception occurs while submitting or waiting the end of the job
      • waitForCompletion

        public static void waitForCompletion​(org.apache.hadoop.mapreduce.Job job,
                                             int maxTry)
                                      throws IOException
        Wait for job completion.
        Parameters:
        job - job to submit
        maxTry - number of try to connect to JobTracker before throwing an exception
        Throws:
        IOException - thrown if the communication with the JobTracker is lost