You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2012/12/04 04:37:51 UTC

svn commit: r1416761 - in /oozie/branches/hcat-intre: core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java release-log.txt

Author: virag
Date: Tue Dec  4 03:37:50 2012
New Revision: 1416761

URL: http://svn.apache.org/viewvc?rev=1416761&view=rev
Log:
OOZIE-1094 credential cannot resolve variable (virag)

Modified:
    oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
    oozie/branches/hcat-intre/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
    oozie/branches/hcat-intre/release-log.txt

Modified: oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java?rev=1416761&r1=1416760&r2=1416761&view=diff
==============================================================================
--- oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java (original)
+++ oozie/branches/hcat-intre/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java Tue Dec  4 03:37:50 2012
@@ -789,7 +789,7 @@ public class JavaActionExecutor extends 
             WorkflowAction action, Configuration actionConf) throws Exception {
         HashMap<String, CredentialsProperties> credPropertiesMap = null;
         if (context != null && action != null) {
-            credPropertiesMap = getActionCredentialsProperties(context, action, actionConf);
+            credPropertiesMap = getActionCredentialsProperties(context, action);
             if (credPropertiesMap != null) {
                 for (String key : credPropertiesMap.keySet()) {
                     CredentialsProperties prop = credPropertiesMap.get(key);
@@ -836,14 +836,14 @@ public class JavaActionExecutor extends 
     }
 
     protected HashMap<String, CredentialsProperties> getActionCredentialsProperties(Context context,
-            WorkflowAction action, Configuration conf) throws Exception {
+            WorkflowAction action) throws Exception {
         HashMap<String, CredentialsProperties> props = new HashMap<String, CredentialsProperties>();
         if (context != null && action != null) {
             String credsInAction = action.getCred();
             log.debug("Get credential '" + credsInAction + "' properties for action : " + action.getId());
             String[] credNames = credsInAction.split(",");
             for (String credName : credNames) {
-                CredentialsProperties credProps = getCredProperties(context, credName, conf);
+                CredentialsProperties credProps = getCredProperties(context, credName);
                 props.put(credName, credProps);
             }
         }
@@ -854,10 +854,11 @@ public class JavaActionExecutor extends 
     }
 
     @SuppressWarnings("unchecked")
-    protected CredentialsProperties getCredProperties(Context context, String credName, Configuration conf)
+    protected CredentialsProperties getCredProperties(Context context, String credName)
             throws Exception {
         CredentialsProperties credProp = null;
         String workflowXml = ((WorkflowJobBean) context.getWorkflow()).getWorkflowInstance().getApp().getDefinition();
+        XConfiguration wfjobConf = new XConfiguration(new StringReader(context.getWorkflow().getConf()));
         Element elementJob = XmlUtils.parseXml(workflowXml);
         Element credentials = elementJob.getChild("credentials", elementJob.getNamespace());
         if (credentials != null) {
@@ -872,7 +873,7 @@ public class JavaActionExecutor extends 
                         String propertyName = property.getChildText("name", property.getNamespace());
                         String propertyValue = property.getChildText("value", property.getNamespace());
                         ELEvaluator eval = new ELEvaluator();
-                        for (Map.Entry<String, String> entry : conf) {
+                        for (Map.Entry<String, String> entry : wfjobConf) {
                             eval.setVariable(entry.getKey(), entry.getValue().trim());
                         }
                         propertyName = eval.evaluate(propertyName, String.class);

Modified: oozie/branches/hcat-intre/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java?rev=1416761&r1=1416760&r2=1416761&view=diff
==============================================================================
--- oozie/branches/hcat-intre/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java (original)
+++ oozie/branches/hcat-intre/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java Tue Dec  4 03:37:50 2012
@@ -788,8 +788,6 @@ public class TestJavaActionExecutor exte
         Element actionXmlconf = XmlUtils.parseXml(action.getConf());
         // action job configuration
         Configuration actionConf = ae.createBaseHadoopConf(context, actionXmlconf);
-        actionConf.set("property3", "prop3");
-        actionConf.set("value3", "val3");
 
         // Setting the credential properties in launcher conf
         HashMap<String, CredentialsProperties> credProperties = ae.setCredentialPropertyToActionConf(context,
@@ -822,6 +820,8 @@ public class TestJavaActionExecutor exte
         conf.set(OozieClient.APP_PATH, getNameNodeUri() + "/testPath");
         conf.set(OozieClient.LOG_TOKEN, "testToken");
         conf.set(OozieClient.USER_NAME, getTestUser());
+        conf.set("property3", "prop3");
+        conf.set("value3", "val3");
 
         WorkflowJobBean wfBean = createWorkflow(app, conf, "auth");
         wfBean.setId(wfId);

Modified: oozie/branches/hcat-intre/release-log.txt
URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/release-log.txt?rev=1416761&r1=1416760&r2=1416761&view=diff
==============================================================================
--- oozie/branches/hcat-intre/release-log.txt (original)
+++ oozie/branches/hcat-intre/release-log.txt Tue Dec  4 03:37:50 2012
@@ -64,10 +64,14 @@ OOZIE-977 NotificationXCommand (job.noti
 OOZIE-654 Provide a way to use 'uber' jars with Oozie MR actions (rkanter via tucu)
 OOZIE-979 bump up trunk version to 3.4.0-SNAPSHOT (tucu)
 
--- Oozie 3.3.0 release (unreleased)
+-- Oozie 3.3.1 (unreleased)
 
+OOZIE-1094 credential cannot resolve variable (virag)
 OOZIE-1099 Pig launcher log does not show the pig job url for H23 (rohini via mona)
 OOZIE-1100 HFTP coordinator input check fails due to missing commons-httpclient.jar (egashira via virag)
+
+-- Oozie 3.3.0 release
+
 OOZIE-1058 ACL modify-job should not be hardcoded to group name(mona via mohammad)
 OOZIE-1052 HadoopAccessorService.createFileSystem throws exception in map-reduce action, failing workflow (egashira via mohammad)
 OOZIE-976 add workflowgenerator into distro tarball (egashira via tucu)