Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-3482

hdfs balancer throws ArrayIndexOutOfBoundsException if option is specified without arguments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-alpha
    • 2.6.0
    • balancer & mover
    • Reviewed

    Description

      When running the hdfs balancer with an option but no argument, we run into an ArrayIndexOutOfBoundsException. It's preferable to print the usage.

      bash-3.2$ hdfs balancer -threshold
      Usage: java Balancer
          [-policy <policy>]	the balancing policy: datanode or blockpool
          [-threshold <threshold>]	Percentage of disk capacity
      Balancing took 261.0 milliseconds
      12/05/31 09:38:46 ERROR balancer.Balancer: Exiting balancer due an exception
      java.lang.ArrayIndexOutOfBoundsException: 1
      	at org.apache.hadoop.hdfs.server.balancer.Balancer$Cli.parse(Balancer.java:1505)
      	at org.apache.hadoop.hdfs.server.balancer.Balancer$Cli.run(Balancer.java:1482)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      	at org.apache.hadoop.hdfs.server.balancer.Balancer.main(Balancer.java:1555)
      bash-3.2$ hdfs balancer -policy
      Usage: java Balancer
          [-policy <policy>]	the balancing policy: datanode or blockpool
          [-threshold <threshold>]	Percentage of disk capacity
      Balancing took 261.0 milliseconds
      12/05/31 09:39:03 ERROR balancer.Balancer: Exiting balancer due an exception
      java.lang.ArrayIndexOutOfBoundsException: 1
      	at org.apache.hadoop.hdfs.server.balancer.Balancer$Cli.parse(Balancer.java:1520)
      	at org.apache.hadoop.hdfs.server.balancer.Balancer$Cli.run(Balancer.java:1482)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      	at org.apache.hadoop.hdfs.server.balancer.Balancer.main(Balancer.java:1555)
      

      Attachments

        1. HDFS-3482-4.patch
          2 kB
          madhukara phatak
        2. HDFS-3482-4.patch
          2 kB
          Uma Maheswara Rao G
        3. HDFS-3482-3.patch
          2 kB
          madhukara phatak
        4. HDFS-3482-2.patch
          3 kB
          madhukara phatak
        5. HDFS-3482-1.patch
          3 kB
          madhukara phatak
        6. HDFS-3482.patch
          1 kB
          madhukara phatak

        Activity

          People

            phatak.dev madhukara phatak
            schu Stephen Chu
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: