Эх сурвалжийг харах

HUE-4363 [core] Do not rely on import hadoop config before loading core

Romain Rigaux 9 жил өмнө
parent
commit
96123f4

+ 3 - 1
apps/beeswax/src/beeswax/create_table.py

@@ -479,7 +479,9 @@ def load_after_create(request, database):
     try:
       remove_header(request.fs, path)
     except Exception, e:
-      raise PopupException(_("The headers of the file could not be removed."), detail=e)
+      msg = "The headers of the file could not be removed."
+      LOG.exception(msg)
+      raise PopupException(_(msg), detail=e)
 
   LOG.debug("Auto loading data from %s into table %s" % (path, tablename))
   hql = "LOAD DATA INPATH '%s' INTO TABLE `%s.%s`" % (path, database, tablename)

+ 2 - 2
desktop/core/src/desktop/lib/paths.py

@@ -91,7 +91,7 @@ def get_config_root(*append):
   """
   Currently gets it based on the Hadoop configuration location.
   """
-  from hadoop.cluster import get_default_fscluster_config
+  from hadoop.conf import HDFS_CLUSTERS
 
-  yarn_site_path = get_default_fscluster_config().HADOOP_CONF_DIR.get()
+  yarn_site_path = HDFS_CLUSTERS['default'].HADOOP_CONF_DIR.get()
   return os.path.abspath(os.path.join(yarn_site_path, '..', *append))

+ 0 - 3
desktop/libs/metadata/src/metadata/conf.py

@@ -21,9 +21,6 @@ from desktop.conf import AUTH_USERNAME as DEFAULT_AUTH_USERNAME, AUTH_PASSWORD a
                          AUTH_PASSWORD_SCRIPT, default_ssl_validate
 from desktop.lib.conf import Config, ConfigSection, coerce_bool, coerce_password_from_script
 from desktop.lib.paths import get_config_root
-from hadoop.cluster import get_default_yarncluster
-
-
 
 
 def get_auth_username():