Преглед изворни кода

HUE-2197 [beeswax] Config check should read warehouse.dir from hive-site.xml

Suhas Satish пре 11 година
родитељ
комит
98984ebfc4
2 измењених фајлова са 6 додато и 1 уклоњено
  1. 2 1
      apps/beeswax/src/beeswax/conf.py
  2. 4 0
      apps/beeswax/src/beeswax/hive_site.py

+ 2 - 1
apps/beeswax/src/beeswax/conf.py

@@ -17,6 +17,7 @@
 
 import os.path
 import sys
+import beeswax.hive_site
 
 from django.utils.translation import ugettext_lazy as _t, ugettext as _
 
@@ -142,7 +143,7 @@ def config_validator(user):
 
   try:
     from hadoop import cluster
-    warehouse = '/user/hive/warehouse'
+    warehouse = beeswax.hive_site.get_metastore_warehouse_dir()
     fs = cluster.get_hdfs()
     fs.stats(warehouse)
   except Exception:

+ 4 - 0
apps/beeswax/src/beeswax/hive_site.py

@@ -40,6 +40,7 @@ _METASTORE_LOC_CACHE = None
 _CNF_METASTORE_SASL = 'hive.metastore.sasl.enabled'
 _CNF_METASTORE_URIS = 'hive.metastore.uris'
 _CNF_METASTORE_KERBEROS_PRINCIPAL = 'hive.metastore.kerberos.principal'
+_CNF_METASTORE_WAREHOUSE_DIR = 'hive.metastore.warehouse.dir'
 
 _CNF_HIVESERVER2_KERBEROS_PRINCIPAL = 'hive.server2.authentication.kerberos.principal'
 _CNF_HIVESERVER2_AUTHENTICATION = 'hive.server2.authentication'
@@ -113,6 +114,9 @@ def get_hiveserver2_kerberos_principal(hostname_or_ip):
   else:
     return None
 
+def get_metastore_warehouse_dir():
+  return get_conf().get(_CNF_METASTORE_WAREHOUSE_DIR, '/user/hive/warehouse')
+
 def get_hiveserver2_authentication():
   return get_conf().get(_CNF_HIVESERVER2_AUTHENTICATION, 'NONE').upper() # NONE == PLAIN SASL