Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18901 5c239d11d -> 538cdee5f


AMBARI-18963. Convert config 'hive.llap.io.memory.size' value from MB to Bytes 
before writing it to hive-site.xml


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 538cdee5f65b5326b3f1e2d2f630010b921991db
Parents: 5c239d1
Author: Swapan Shridhar <[email protected]>
Authored: Tue Nov 22 12:42:04 2016 -0800
Committer: Swapan Shridhar <[email protected]>
Committed: Tue Nov 22 12:42:04 2016 -0800

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive_interactive.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/538cdee5/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
index fa6d6a0..298db2a 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
@@ -58,6 +58,7 @@ Sets up the configs, jdbc connection and tarball copy to HDFS 
for Hive Server In
 @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
 def hive_interactive(name=None):
   import params
+  MB_TO_BYTES = 1048576
 
   # Create Hive User Dir
   params.HdfsResource(params.hive_hdfs_user_dir,
@@ -108,6 +109,17 @@ def hive_interactive(name=None):
       del merged_hive_interactive_site[item]
 
   '''
+  Config 'hive.llap.io.memory.size' calculated value in stack_advisor is in MB 
as of now. We need to
+  convert it to bytes before we write it down to config file.
+  '''
+  if 'hive.llap.io.memory.size' in merged_hive_interactive_site.keys():
+    hive_llap_io_mem_size_in_mb = 
merged_hive_interactive_site.get("hive.llap.io.memory.size")
+    hive_llap_io_mem_size_in_bytes = long(hive_llap_io_mem_size_in_mb) * 
MB_TO_BYTES
+    merged_hive_interactive_site['hive.llap.io.memory.size'] = 
hive_llap_io_mem_size_in_bytes
+    Logger.info("Converted 'hive.llap.io.memory.size' value from '{0} MB' to 
'{1} Bytes' before writing "
+                "it to config file.".format(hive_llap_io_mem_size_in_mb, 
hive_llap_io_mem_size_in_bytes))
+
+  '''
   Hive2 doesn't have support for Atlas, we need to remove the Hook 
'org.apache.atlas.hive.hook.HiveHook',
   which would have come in config 'hive.exec.post.hooks' during the site merge 
logic, if Atlas is installed.
   '''

Reply via email to