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();
WARNING: In one GuaguaMapReduceClient instance, addJob(String[]) to make sure job names are no duplicated.
If one job is failed, it will be re-submitted again and try, if failed times over two, no re-try.
| Constructor and Description |
|---|
GuaguaMapReduceClient()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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(Set<String> successJobs,
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 |
createJob(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.
|
int |
run()
Run all jobs added to JobControl.
|
String |
toFakedStateString(org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob controlledJob) |
public GuaguaMapReduceClient()
public void addJob(String[] args) throws IOException
IOExceptionpublic int run()
throws IOException
IOExceptionpublic String toFakedStateString(org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob controlledJob)
protected double calculateProgress(Set<String> successJobs, org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl jc, org.apache.hadoop.mapred.JobClient jobClient) throws IOException
jc - The JobControl object that has been submittedjobClient - The JobClient to which it has been submittedIOException - In case any IOException connecting to JobTracker.protected double progressOfRunningJob(org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob cjob,
org.apache.hadoop.mapred.JobClient jobClient)
throws IOException
cjob - - The Job for which progress is requiredjobClient - - the JobClient to which it has been submittedIOException - In case any IOException connecting to JobTracker.public static void addInputPath(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionpublic org.apache.hadoop.mapreduce.Job createJob(String[] args) throws IOException
IOExceptionpublic static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException
Copyright © 2019. All Rights Reserved.