hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r806065 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobConf.java
Date Thu, 20 Aug 2009 06:34:30 GMT
Author: yhemanth
Date: Thu Aug 20 06:34:29 2009
New Revision: 806065

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

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobConf.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=806065&r1=806064&r2=806065&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Thu Aug 20 06:34:29 2009
@@ -409,3 +409,7 @@
     MAPREDUCE-773. Sends progress reports for compressed gzip inputs in maps.
     Fixes a native direct buffer leak in LineRecordReader classes.
     (Hong Tang and ddas)
+
+    MAPREDUCE-832. Reduce number of warning messages printed when
+    deprecated memory variables are used. (Rahul Kumar Singh via yhemanth)
+

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobConf.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobConf.java?rev=806065&r1=806064&r2=806065&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobConf.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobConf.java Thu Aug 20 06:34:29
2009
@@ -307,7 +307,9 @@
   /**
    * Construct a map/reduce job configuration.
    */
-  public JobConf() {}
+  public JobConf() {
+    checkAndWarnDeprecation();
+  }
 
   /** 
    * Construct a map/reduce job configuration.
@@ -316,6 +318,7 @@
    */
   public JobConf(Class exampleClass) {
     setJarByClass(exampleClass);
+    checkAndWarnDeprecation();
   }
   
   /**
@@ -325,6 +328,7 @@
    */
   public JobConf(Configuration conf) {
     super(conf);
+    checkAndWarnDeprecation();
   }
 
 
@@ -354,6 +358,7 @@
   public JobConf(Path config) {
     super();
     addResource(config);
+    checkAndWarnDeprecation();
   }
 
   /** A new map/reduce configuration where the behavior of reading from the
@@ -366,6 +371,7 @@
    */
   public JobConf(boolean loadDefaults) {
     super(loadDefaults);
+    checkAndWarnDeprecation();
   }
 
   /**
@@ -1570,12 +1576,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 :
@@ -1592,11 +1592,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 :
@@ -1808,8 +1803,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