public class Balancer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
addBalancingPlan(org.apache.hadoop.conf.Configuration clientConf)
Augments the supplied Configuration with information required to use the partition plan.
|
static org.apache.hadoop.conf.Configuration |
configureCountingReducer(org.apache.hadoop.conf.Configuration conf)
Configures a job for reducer load analysis.
|
static Balancer |
createBalancer(org.apache.hadoop.conf.Configuration conf)
Returns a Balancer after validating configuration properties.
|
static boolean |
save(org.apache.hadoop.mapreduce.Job clientJob)
This method is used in API mode when the client job is a mapreduce job.
|
static boolean |
save(org.apache.hadoop.mapred.RunningJob clientJob, org.apache.hadoop.conf.Configuration conf)
This method is used in API mode when the client job is a mapred job.
|
void |
waitForCompletion()
Creates a balancing plan for the job.
|
public org.apache.hadoop.conf.Configuration addBalancingPlan(org.apache.hadoop.conf.Configuration clientConf) throws java.io.IOException
oracle.hadoop.balancer.mapred.BalancedPartitioner
or oracle.hadoop.balancer.mapreduce.BalancedPartitioner
clientConf
- the Configuration of the user/client jobjava.io.IOException
public static org.apache.hadoop.conf.Configuration configureCountingReducer(org.apache.hadoop.conf.Configuration conf)
conf
- the job configurationpublic static Balancer createBalancer(org.apache.hadoop.conf.Configuration conf) throws java.io.IOException, java.lang.InterruptedException
mapred.JobConf
or conf.Configuration (mapreduce)
java.io.IOException
java.lang.InterruptedException
public static boolean save(org.apache.hadoop.mapreduce.Job clientJob)
If the client job runs successfully, the partition report will be saved in ${mapred.output.dir}/_balancer; otherwise, the partition report will be ${oracle.hadoop.balancer.reportPath}.
If configureCountingReducer(org.apache.hadoop.conf.Configuration)
has been called, the job analyzer report will include detailed reducer statistics if they can be obtained from the clientJob.
The report directory will be created if it does not exist.
This method is for jobs using the org.apache.hadoop.mapreduce
interface.
If an error occurs, this method prints a warning message and returns false.
clientJob
- the submitted RunningJob
configureCountingReducer(org.apache.hadoop.conf.Configuration)
public static boolean save(org.apache.hadoop.mapred.RunningJob clientJob, org.apache.hadoop.conf.Configuration conf)
If the client job runs successfully, the partition report will be saved in ${mapred.output.dir}/_balancer; otherwise, the partition report will be ${oracle.hadoop.balancer.reportPath}.
If configureCountingReducer(org.apache.hadoop.conf.Configuration)
has been called, the job analyzer report will include detailed reducer statistics if they can be obtained from the clientJob.
The report directory will be created if it does not exist.
This method is for jobs using the org.apache.hadoop.mapred
interface.
If an error occurs, this method prints a warning message and returns false.
clientJob
- the submitted RunningJob
conf
- The Configuration
object of clientJob
It should be clientJob
.getConfiguration()configureCountingReducer(org.apache.hadoop.conf.Configuration)
public void waitForCompletion() throws java.io.IOException, java.lang.InterruptedException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.InterruptedException
java.lang.ClassNotFoundException