hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject [1/2] hive git commit: HIVE-12769 : LLAP: Pick up java_home from System properties for Slider (Gopal V, reviewed by Sergey Shelukhin)
Date Mon, 25 Jan 2016 21:59:22 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.0 0c7009734 -> d3954f777
  refs/heads/master 8e0d18e66 -> f97081bd4


HIVE-12769 : LLAP: Pick up java_home from System properties for Slider (Gopal V, reviewed
by Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f97081bd
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f97081bd
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f97081bd

Branch: refs/heads/master
Commit: f97081bd42edbd3f8ffec2bc274f23459c71b2ea
Parents: 8e0d18e
Author: Sergey Shelukhin <sershe@apache.org>
Authored: Mon Jan 25 13:59:02 2016 -0800
Committer: Sergey Shelukhin <sershe@apache.org>
Committed: Mon Jan 25 13:59:02 2016 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/llap/cli/LlapServiceDriver.java   | 11 +++++++++++
 llap-server/src/main/resources/package.py                |  4 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/f97081bd/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
index a39be15..544af09 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java
@@ -272,9 +272,20 @@ public class LlapServiceDriver {
 
     lfs.copyFromLocalFile(new Path(logger.toString()), confPath);
 
+    String java_home = System.getenv("JAVA_HOME");
+    String jre_home = System.getProperty("java.home");
+    if (java_home == null) {
+      java_home = jre_home;
+    } else if (!java_home.equals(jre_home)) {
+      LOG.warn("Java versions might not match : JAVA_HOME=%s,process jre=%s", 
+          java_home, jre_home);
+    }
+
     // extract configs for processing by the python fragments in Slider
     JSONObject configs = new JSONObject();
 
+    configs.put("java.home", java_home);
+
     configs.put(ConfVars.LLAP_DAEMON_YARN_CONTAINER_MB.varname, HiveConf.getIntVar(conf,
         ConfVars.LLAP_DAEMON_YARN_CONTAINER_MB));
 

http://git-wip-us.apache.org/repos/asf/hive/blob/f97081bd/llap-server/src/main/resources/package.py
----------------------------------------------------------------------
diff --git a/llap-server/src/main/resources/package.py b/llap-server/src/main/resources/package.py
index 5620483..20a2510 100644
--- a/llap-server/src/main/resources/package.py
+++ b/llap-server/src/main/resources/package.py
@@ -71,6 +71,7 @@ def main(args):
 		sys.exit(1)
 		return
 	config = json_parse(open(join(input, "config.json")).read())
+	java_home = config["java.home"]
 	resource = LlapResource(config)
 	# 5% container failure every monkey_interval seconds
 	monkey_percentage = 5 # 5%
@@ -82,7 +83,7 @@ def main(args):
 		"container.mb" : resource.container_size,
 		"container.cores" : resource.container_cores,
 		"hadoop_home" : os.getenv("HADOOP_HOME"),
-		"java_home" : os.getenv("JAVA_HOME"),
+		"java_home" : java_home,
 		"name" : args.name,
 		"daemon_args" : args.args,
 		"daemon_loglevel" : args.loglevel,
@@ -141,3 +142,4 @@ def main(args):
 
 if __name__ == "__main__":
 	main(sys.argv[1:])
+# vim: ai ts=4 noet sw=4 ft=python


Mime
View raw message