ml.shifu.guagua.mapreduce
类 GuaguaMapReduceClient

java.lang.Object
  继承者 ml.shifu.guagua.mapreduce.GuaguaMapReduceClient

public class GuaguaMapReduceClient
extends Object

GuaguaMapReduceClient is the entry point for guagua mapreduce implementation application.

To use it in normal Hadoop mode. Use main(String[]) as entry point.

To run jobs in parallel:

 GuaguaMapReduceClient client = new GuaguaMapReduceClient();
 client.addJob(args);
 client.addJob(args);
 client.run();
 


构造方法摘要
GuaguaMapReduceClient()
          Default constructor.
 
方法摘要
static void addInputPath(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path)
           
 void addJob(String[] args)
          Add new job to JobControl instance.
protected  double calculateProgress(org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl jc, org.apache.hadoop.mapred.JobClient jobClient)
          Compute the progress of the current job submitted through the JobControl object jc to the JobClient jobClient
 org.apache.hadoop.mapreduce.Job creatJob(String[] args)
          Create Hadoop job according to arguments from main.
static void main(String[] args)
           
protected  double progressOfRunningJob(org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob cjob, org.apache.hadoop.mapred.JobClient jobClient)
          Returns the progress of a Job j which is part of a submitted JobControl object.
 void run()
          Run all jobs added to JobControl.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

GuaguaMapReduceClient

public GuaguaMapReduceClient()
Default constructor. Construct default JobControl instance.

方法详细信息

addJob

public void addJob(String[] args)
            throws IOException
Add new job to JobControl instance.

抛出:
IOException

run

public void run()
         throws IOException
Run all jobs added to JobControl.

抛出:
IOException

calculateProgress

protected double calculateProgress(org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl jc,
                                   org.apache.hadoop.mapred.JobClient jobClient)
                            throws IOException
Compute the progress of the current job submitted through the JobControl object jc to the JobClient jobClient

参数:
jc - The JobControl object that has been submitted
jobClient - The JobClient to which it has been submitted
返回:
The progress as a percentage in double format
抛出:
IOException - In case any IOException connecting to JobTracker.

progressOfRunningJob

protected double progressOfRunningJob(org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob cjob,
                                      org.apache.hadoop.mapred.JobClient jobClient)
                               throws IOException
Returns the progress of a Job j which is part of a submitted JobControl object. The progress is for this Job. So it has to be scaled down by the num of jobs that are present in the JobControl.

参数:
cjob - - The Job for which progress is required
jobClient - - the JobClient to which it has been submitted
返回:
Returns the percentage progress of this Job
抛出:
IOException - In case any IOException connecting to JobTracker.

addInputPath

public static void addInputPath(org.apache.hadoop.conf.Configuration conf,
                                org.apache.hadoop.fs.Path path)
                         throws IOException
抛出:
IOException

creatJob

public org.apache.hadoop.mapreduce.Job creatJob(String[] args)
                                         throws IOException
Create Hadoop job according to arguments from main.

抛出:
IOException

main

public static void main(String[] args)
                 throws IOException,
                        InterruptedException,
                        ClassNotFoundException
抛出:
IOException
InterruptedException
ClassNotFoundException


Copyright © 2014. All Rights Reserved.