Sfoglia il codice sorgente

AMBARI-5335. Change Ambari to not upload Hive jar and to not set hive.jar.directory. (swagle)

Siddharth Wagle 11 anni fa
parent
commit
9764cb95bc

+ 1 - 3
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_server.py

@@ -21,7 +21,6 @@ limitations under the License.
 from resource_management import *
 from hive import hive
 from hive_service import hive_service
-from install_jars import install_hive_exec_jar
 from install_jars import install_tez_jars
 
 class HiveServer(Script):
@@ -41,8 +40,7 @@ class HiveServer(Script):
     self.configure(env) # FOR SECURITY
     
     install_tez_jars() # Put tez jars in hdfs
-    install_hive_exec_jar() # Put hive exec jar in hdfs
-    
+
     hive_service( 'hiveserver2',
                   action = 'start'
     )

+ 0 - 52
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py

@@ -19,61 +19,9 @@ limitations under the License.
 """
 
 from resource_management import *
-
 import os
 import fnmatch
 
-def install_hive_exec_jar():
-  import params
-  
-  hdfs_path_prefix = 'hdfs://'
-  if params.tez_lib_uris:
-    hdfs_path = params.hive_exec_hdfs_path
-
-    if hdfs_path.strip().find(hdfs_path_prefix, 0) != -1:
-      hdfs_path = hdfs_path.replace(hdfs_path_prefix, '')
-    pass
-
-    params.HdfsDirectory(hdfs_path,
-                         action="create",
-                         owner=params.hive_user,
-                         mode=0755
-    )
-
-    if params.security_enabled:
-      kinit_if_needed = format("{kinit_path_local} -kt {hdfs_user_keytab} {hdfs_user};")
-    else:
-      kinit_if_needed = ""
-
-    if kinit_if_needed:
-      Execute(kinit_if_needed,
-              user=params.tez_user,
-              path='/bin'
-      )
-
-    hive_exec_jar_path = find_hive_exec_jar_path(params.hive_lib)
-    if hive_exec_jar_path is None:
-      hive_exec_jar_path = params.hive_exec_jar_path
-    pass
-
-    CopyFromLocal(hive_exec_jar_path,
-                  mode=0755,
-                  owner=params.hive_user,
-                  dest_dir=hdfs_path,
-                  kinnit_if_needed=kinit_if_needed,
-                  hdfs_user=params.hdfs_user
-    )
-  pass
-
-def find_hive_exec_jar_path(hive_lib_dir):
-  if os.path.exists(hive_lib_dir) and os.path.isdir(hive_lib_dir):
-    for file in os.listdir(hive_lib_dir):
-      file_path = os.path.join(hive_lib_dir, file)
-      if fnmatch.fnmatch(file, 'hive-exec*.jar') and not os.path.islink(file_path):
-        return file_path
-    pass
-  pass
-
 def install_tez_jars():
   import params
   

+ 0 - 3
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py

@@ -169,9 +169,6 @@ tez_local_api_jars = '/usr/lib/tez/tez*.jar'
 tez_local_lib_jars = '/usr/lib/tez/lib/*.jar'
 tez_user = config['configurations']['global']['tez_user']
 
-hive_exec_jar_path = '/usr/lib/hive/lib/hive-exec.jar'
-hive_exec_hdfs_path = default('/configurations/hive-site/hive.jar.directory', '/apps/hive/install')
-
 import functools
 #create partial functions with common arguments for every HdfsDirectory call
 #to create hdfs directory we need to call params.HdfsDirectory in code

+ 0 - 9
ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml

@@ -381,15 +381,6 @@ limitations under the License.
     <description>The max memory to be used for hash in RS operator for top K selection.</description>
   </property>
 
-  <property>
-    <name>hive.jar.directory</name>
-    <value>hdfs:///apps/hive/install</value>
-    <description>
-      This is the location hive in Tez mode will look for to find a site wide
-      installed hive instance.
-    </description>
-  </property>
-
   <property>
     <name>hive.server2.tez.default.queues</name>
     <value></value>

+ 0 - 20
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py

@@ -114,26 +114,6 @@ class TestHiveServer(RMFTestCase):
                               hdfs_user='hdfs'
     )
 
-    self.assertResourceCalled('HdfsDirectory', '/apps/hive/install',
-                              security_enabled = False,
-                              mode = 0755,
-                              owner = 'hive',
-                              keytab = UnknownConfigurationMock(),
-                              conf_dir = '/etc/hadoop/conf',
-                              hdfs_user = 'hdfs',
-                              kinit_path_local = '/usr/bin/kinit',
-                              action = ['create']
-    )
-
-    self.assertResourceCalled('CopyFromLocal', '/usr/lib/hive/lib/hive-exec.jar',
-                              mode=0755,
-                              owner='hive',
-                              dest_dir='/apps/hive/install',
-                              kinnit_if_needed='',
-                              hdfs_user='hdfs'
-    )
-
-
     self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 /tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.log /var/run/hive/hive-server.pid /etc/hive/conf.server',
                               not_if = 'ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1',
                               user = 'hive'