浏览代码

HUE-8587 [jb] Fix Jobbrowser to work with Smart Connection Pool

(cherry picked from commit f426d07012bc207157d8395de5f3aeb49312f32d)
jdesjean 7 年之前
父节点
当前提交
c6ea3ca
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 2 0
      apps/beeswax/src/beeswax/server/hive_server2_lib.py
  2. 2 2
      apps/impala/src/impala/server.py

+ 2 - 0
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -607,6 +607,8 @@ class HiveServerClient:
     req = TOpenSessionReq(**kwargs)
     req = TOpenSessionReq(**kwargs)
     res = self._client.OpenSession(req)
     res = self._client.OpenSession(req)
     self.coordinator_host = self._client.get_coordinator_host()
     self.coordinator_host = self._client.get_coordinator_host()
+    if self.coordinator_host:
+      res.configuration['coordinator_host'] = self.coordinator_host
 
 
     if res.status is not None and res.status.statusCode not in (TStatusCode.SUCCESS_STATUS,):
     if res.status is not None and res.status.statusCode not in (TStatusCode.SUCCESS_STATUS,):
       if hasattr(res.status, 'errorMessage') and res.status.errorMessage:
       if hasattr(res.status, 'errorMessage') and res.status.errorMessage:

+ 2 - 2
apps/impala/src/impala/server.py

@@ -50,8 +50,8 @@ def get_api(user, url):
 
 
 
 
 def _get_impala_server_url(session):
 def _get_impala_server_url(session):
-  impala_settings = session.get_formatted_properties()
-  http_addr = next((setting['value'] for setting in impala_settings if setting['key'].lower() == 'http_addr'), None)
+  properties = session.get_properties()
+  http_addr = properties.get('coordinator_host', properties.get('http_addr'))
   # Remove scheme if found
   # Remove scheme if found
   http_addr = http_addr.replace('http://', '').replace('https://', '')
   http_addr = http_addr.replace('http://', '').replace('https://', '')
   return ('https://' if get_webserver_certificate_file() else 'http://') + http_addr
   return ('https://' if get_webserver_certificate_file() else 'http://') + http_addr