org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Toolpublic class DiskBalancerCLI
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
For example, if you have 3 disks, with 100 GB , 600 GB and 200 GB on each disk, this tool will ensure that each disk will have 300 GB.
This tool can be run while data nodes are fully functional.
At very high level diskbalancer computes a set of moves that will make disk utilization equal and then those moves are executed by the datanode.
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
BANDWIDTH |
Specifies the maximum disk bandwidth to use per second.
|
static java.lang.String |
BEFORE_TEMPLATE |
Template for the Before File.
|
static java.lang.String |
CANCEL |
Cancels a running plan.
|
static int |
DEFAULT_TOP |
specify default top number of nodes to be processed.
|
static java.lang.String |
EXECUTE |
Executes a given plan file on the target datanode.
|
static java.lang.String |
HELP |
Help for the program.
|
static java.lang.String |
MAXERROR |
Specifies the maximum errors to tolerate.
|
static java.lang.String |
NODE |
Name or address of the node to execute against.
|
static java.lang.String |
OUTFILE |
Output file name, for commands like report, plan etc.
|
static java.lang.String |
PLAN |
Computes a plan for a given set of nodes.
|
static java.lang.String |
PLAN_TEMPLATE |
Template for the plan file.
|
static int |
PLAN_VERSION |
|
static java.lang.String |
QUERY |
Reports the status of disk balancer operation.
|
static java.lang.String |
REPORT |
The report command prints out a disk fragmentation report about the data
cluster.
|
static java.lang.String |
SKIPDATECHECK |
Skips date check(now by default the plan is valid for 24 hours), and force
execute the plan.
|
static java.lang.String |
THRESHOLD |
Percentage of data unevenness that we are willing to live with.
|
static java.lang.String |
TOP |
specify top number of nodes to be processed.
|
static java.lang.String |
VERBOSE |
Runs the command in verbose mode.
|
| Constructor | Description |
|---|---|
DiskBalancerCLI(org.apache.hadoop.conf.Configuration conf) |
Construct a DiskBalancer.
|
DiskBalancerCLI(org.apache.hadoop.conf.Configuration conf,
java.io.PrintStream printStream) |
| Modifier and Type | Method | Description |
|---|---|---|
static org.apache.commons.cli.Options |
getCancelOptions() |
Returns Cancel Options.
|
Command |
getCurrentCommand() |
Gets current command associated with this instance of DiskBalancer.
|
static org.apache.commons.cli.Options |
getExecuteOptions() |
Retuns execute options.
|
static org.apache.commons.cli.Options |
getHelpOptions() |
Returns help options.
|
static org.apache.commons.cli.Options |
getPlanOptions() |
Returns Plan options.
|
static org.apache.commons.cli.Options |
getQueryOptions() |
Returns Query Options.
|
static org.apache.commons.cli.Options |
getReportOptions() |
Returns Report Options.
|
static void |
main(java.lang.String[] argv) |
Main for the DiskBalancer Command handling.
|
int |
run(java.lang.String[] args) |
Execute the command with the given arguments.
|
public static final java.lang.String PLAN
public static final java.lang.String OUTFILE
public static final java.lang.String HELP
public static final java.lang.String THRESHOLD
public static final java.lang.String BANDWIDTH
public static final java.lang.String MAXERROR
public static final java.lang.String EXECUTE
public static final java.lang.String SKIPDATECHECK
public static final java.lang.String REPORT
public static final java.lang.String TOP
public static final int DEFAULT_TOP
public static final java.lang.String NODE
public static final java.lang.String VERBOSE
public static final int PLAN_VERSION
public static final java.lang.String QUERY
public static final java.lang.String CANCEL
public static final java.lang.String BEFORE_TEMPLATE
public static final java.lang.String PLAN_TEMPLATE
public DiskBalancerCLI(org.apache.hadoop.conf.Configuration conf)
conf - public DiskBalancerCLI(org.apache.hadoop.conf.Configuration conf,
java.io.PrintStream printStream)
public static void main(java.lang.String[] argv)
throws java.lang.Exception
argv - - System Args Strings[]java.lang.Exceptionpublic int run(java.lang.String[] args)
throws java.lang.Exception
run in interface org.apache.hadoop.util.Toolargs - command specific arguments.java.lang.Exceptionpublic static org.apache.commons.cli.Options getPlanOptions()
public static org.apache.commons.cli.Options getHelpOptions()
public static org.apache.commons.cli.Options getExecuteOptions()
public static org.apache.commons.cli.Options getQueryOptions()
public static org.apache.commons.cli.Options getCancelOptions()
public static org.apache.commons.cli.Options getReportOptions()
public Command getCurrentCommand()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.