hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r806068 - in /hadoop/common/branches/branch-0.20: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobConf.java
Date Thu, 20 Aug 2009 06:45:23 GMT
Author: yhemanth
Date: Thu Aug 20 06:45:23 2009
New Revision: 806068

URL: http://svn.apache.org/viewvc?rev=806068&view=rev
Log:
MAPREDUCE-832. Reduce number of warning messages printed when deprecated memory variables
are used. Contributed by Rahul Kumar Singh.

Modified:
    hadoop/common/branches/branch-0.20/CHANGES.txt
    hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobConf.java

Modified: hadoop/common/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/CHANGES.txt?rev=806068&r1=806067&r2=806068&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20/CHANGES.txt Thu Aug 20 06:45:23 2009
@@ -214,6 +214,9 @@
     (Bill Zeller via szetszwo)
 
     HDFS-527. Remove unnecessary DFSClient constructors.  (szetszwo)
+
+    MAPREDUCE-832. Reduce number of warning messages printed when 
+    deprecated memory variables are used. (Rahul Kumar Singh via yhemanth)
  
 Release 0.20.0 - 2009-04-15
 

Modified: hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobConf.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobConf.java?rev=806068&r1=806067&r2=806068&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobConf.java (original)
+++ hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobConf.java Thu
Aug 20 06:45:23 2009
@@ -160,7 +160,9 @@
   /**
    * Construct a map/reduce job configuration.
    */
-  public JobConf() {}
+  public JobConf() {
+    checkAndWarnDeprecation();
+  }
 
   /** 
    * Construct a map/reduce job configuration.
@@ -169,6 +171,7 @@
    */
   public JobConf(Class exampleClass) {
     setJarByClass(exampleClass);
+    checkAndWarnDeprecation();
   }
   
   /**
@@ -178,6 +181,7 @@
    */
   public JobConf(Configuration conf) {
     super(conf);
+    checkAndWarnDeprecation();
   }
 
 
@@ -207,6 +211,7 @@
   public JobConf(Path config) {
     super();
     addResource(config);
+    checkAndWarnDeprecation();
   }
 
   /** A new map/reduce configuration where the behavior of reading from the
@@ -219,6 +224,7 @@
    */
   public JobConf(boolean loadDefaults) {
     super(loadDefaults);
+    checkAndWarnDeprecation();
   }
 
   /**
@@ -1423,12 +1429,6 @@
 
   public long getMemoryForMapTask() {
     if (get(MAPRED_TASK_MAXVMEM_PROPERTY) != null) {
-      LOG.warn(
-        JobConf.deprecatedString(
-          JobConf.MAPRED_TASK_MAXVMEM_PROPERTY)+
-          " instead use  "+JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY + " and "
-          + JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY);
-
       long val = getLong(
         MAPRED_TASK_MAXVMEM_PROPERTY, DISABLED_MEMORY_LIMIT);
       return (val == DISABLED_MEMORY_LIMIT) ? val :
@@ -1445,11 +1445,6 @@
 
   public long getMemoryForReduceTask() {
     if (get(MAPRED_TASK_MAXVMEM_PROPERTY) != null) {
-      LOG.warn(
-        JobConf.deprecatedString(
-          JobConf.MAPRED_TASK_MAXVMEM_PROPERTY)+
-        " instead use  "+JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY + " and "
-        + JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY);
       long val = getLong(
         MAPRED_TASK_MAXVMEM_PROPERTY, DISABLED_MEMORY_LIMIT);
       return (val == DISABLED_MEMORY_LIMIT) ? val :
@@ -1628,8 +1623,17 @@
   }
 
   static String deprecatedString(String key) {
-    return "The variable " + key + " is no longer used";
+    return "The variable " + key + " is no longer used.";
+  }
+
+  private void checkAndWarnDeprecation() {
+    if(get(JobConf.MAPRED_TASK_MAXVMEM_PROPERTY) != null) {
+      LOG.warn(JobConf.deprecatedString(JobConf.MAPRED_TASK_MAXVMEM_PROPERTY)
+                + " Instead use " + JobConf.MAPRED_JOB_MAP_MEMORY_MB_PROPERTY
+                + " and " + JobConf.MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY);
+    }
   }
+  
 
 }
 



Mime
View raw message