Author: tucu
Date: Thu Mar 22 05:54:30 2012
New Revision: 1303661

URL: http://svn.apache.org/viewvc?rev=1303661&view=rev
Log:
OOZIE-777 Hadoop 0.23 removed org.apache.hadoop.mapred.Task group name breaking 
EL counters() (tucu)

Modified:
    
incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HadoopELFunctions.java
    incubator/oozie/trunk/release-log.txt

Modified: 
incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HadoopELFunctions.java
URL: 
http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HadoopELFunctions.java?rev=1303661&r1=1303660&r2=1303661&view=diff
==============================================================================
--- 
incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HadoopELFunctions.java
 (original)
+++ 
incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/HadoopELFunctions.java
 Thu Mar 22 05:54:30 2012
@@ -17,14 +17,12 @@
  */
 package org.apache.oozie.action.hadoop;
 
-import org.apache.hadoop.mapred.Counters;
 import org.apache.oozie.DagELFunctions;
 import org.apache.oozie.util.ELEvaluationException;
 import org.apache.oozie.util.XLog;
 import org.apache.oozie.workflow.WorkflowInstance;
 import org.json.simple.JSONValue;
 
-import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -41,6 +39,8 @@ public class HadoopELFunctions {
     public static final String REDUCE_OUT = "REDUCE_OUTPUT_RECORDS";
     public static final String GROUPS = "REDUCE_INPUT_GROUPS";
 
+    private static final String RECORDS_023 = 
"org.apache.hadoop.mapreduce.TaskCounter";
+
     @SuppressWarnings("unchecked")
     public static Map<String, Map<String, Long>> hadoop_counters(String 
nodeName) throws ELEvaluationException {
         WorkflowInstance instance = 
DagELFunctions.getWorkflow().getWorkflowInstance();
@@ -48,6 +48,11 @@ public class HadoopELFunctions {
         Map<String, Map<String, Long>> counters = (Map<String, Map<String, 
Long>>) obj;
         if (counters == null) {
             counters = getCounters(nodeName);
+            // In Hadoop 0.23 they deprecated 
'org.apache.hadoop.mapred.Task$Counter' and they REMOVED IT
+            // Here we are getting the new Name and inserting it using the old 
name if the old name is not found
+            if (counters.get(RECORDS) == null) {
+                counters.put(RECORDS, counters.get(RECORDS_023));
+            }
             instance.setTransientVar(nodeName + 
WorkflowInstance.NODE_VAR_SEPARATOR + HADOOP_COUNTERS, counters);
         }
         return counters;

Modified: incubator/oozie/trunk/release-log.txt
URL: 
http://svn.apache.org/viewvc/incubator/oozie/trunk/release-log.txt?rev=1303661&r1=1303660&r2=1303661&view=diff
==============================================================================
--- incubator/oozie/trunk/release-log.txt (original)
+++ incubator/oozie/trunk/release-log.txt Thu Mar 22 05:54:30 2012
@@ -1,5 +1,6 @@
 -- Oozie 3.2.0 release
 
+OOZIE-777 Hadoop 0.23 removed org.apache.hadoop.mapred.Task$Counter group name 
breaking EL counters() (tucu)
 OOZIE-776 custom-main example job.properties is missing the activation of 
sharelib (tucu)
 OOZIE-775 sharelibs assembly does not include deps with compile scope (tucu)
 OOZIE-758 Oozie logs should record job-id for when job is submitted (Mona via 
Mohammad)


Reply via email to