apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [33/50] incubator-apex-core git commit: APEXCORE-303 #resolve evaluate the launch properties at application launch
Date Fri, 29 Jan 2016 07:21:52 GMT
APEXCORE-303 #resolve evaluate the launch properties at application launch


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/commit/ec0c88b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/tree/ec0c88b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/diff/ec0c88b1

Branch: refs/heads/master
Commit: ec0c88b183d82257da185d42e664bd95474ad206
Parents: 56b55fe
Author: David Yan <david@datatorrent.com>
Authored: Fri Jan 8 16:23:52 2016 -0800
Committer: David Yan <david@datatorrent.com>
Committed: Fri Jan 8 16:23:52 2016 -0800

----------------------------------------------------------------------
 .../com/datatorrent/stram/client/StramAppLauncher.java |  1 +
 .../com/datatorrent/stram/client/StramClientUtils.java | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/ec0c88b1/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java b/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
index f1e7261..d3666d4 100644
--- a/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
+++ b/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
@@ -435,6 +435,7 @@ public class StramAppLauncher
         conf.set(entry.getKey(), entry.getValue());
       }
     }
+    StramClientUtils.evalConfiguration(conf);
     return conf;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/ec0c88b1/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java b/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java
index 27f58f0..7e23fa5 100644
--- a/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java
+++ b/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java
@@ -659,7 +659,6 @@ public class StramClientUtils
       engine.eval("var _prop = {}");
       for (Map.Entry<String, String> entry : vars) {
         String evalString = String.format("_prop[\"%s\"] = \"%s\"", StringEscapeUtils.escapeJava(entry.getKey()),
StringEscapeUtils.escapeJava(entry.getValue()));
-        LOG.debug("Evaluating: {}", evalString);
         engine.eval(evalString);
       }
     } catch (ScriptException ex) {
@@ -709,6 +708,18 @@ public class StramClientUtils
     }
   }
 
+  public static void evalConfiguration(Configuration conf)
+  {
+    Properties props = new Properties();
+    for (Map.Entry entry : conf) {
+      props.put(entry.getKey(), entry.getValue());
+    }
+    evalProperties(props, conf);
+    for (Map.Entry<Object, Object> entry : props.entrySet()) {
+      conf.set((String)entry.getKey(), (String)entry.getValue());
+    }
+  }
+
   public static <T> T doAs(String userName, PrivilegedExceptionAction<T> action)
throws Exception
   {
     if (StringUtils.isNotBlank(userName) && !userName.equals(UserGroupInformation.getLoginUser().getShortUserName()))
{


Mime
View raw message