Procházet zdrojové kódy

HDFS-4558. Fix the NPE thrown when starting balancer. Contributed by Junping Du

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1454234 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze před 12 roky
rodič
revize
edc8ce5ce1

+ 2 - 0
CHANGES.txt

@@ -537,6 +537,8 @@ Release 1.2.0 - unreleased
     HADOOP-9369. DNS#reverseDns() can return hostname with . appended at the
     end. (Karthik Kambatla via atm)
 
+    HDFS-4558. Fix the NPE thrown when starting balancer.  (Junping Du via szetszwo)
+
 Release 1.1.2 - 2013.01.30
 
   INCOMPATIBLE CHANGES

+ 2 - 6
src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java

@@ -803,11 +803,6 @@ public class Balancer implements Tool {
     }
   }
 
-  /** Default constructor */
-  Balancer() throws UnsupportedActionException {
-    checkReplicationPolicyCompatibility(getConf());
-  }
-
   /** Construct a balancer from the given configuration */
   Balancer(Configuration conf) throws UnsupportedActionException {
     checkReplicationPolicyCompatibility(conf);
@@ -828,7 +823,8 @@ public class Balancer implements Tool {
    */
   public static void main(String[] args) {
     try {
-      System.exit( ToolRunner.run(null, new Balancer(), args) );
+      Configuration conf = new Configuration();
+      System.exit( ToolRunner.run(conf, new Balancer(conf), args) );
     } catch (Throwable e) {
       LOG.error(StringUtils.stringifyException(e));
       System.exit(-1);