فهرست منبع

HUE-9234 [core] Add coordinator_url in hue.ini config in impala section (#1089)

Prakash Ranade 5 سال پیش
والد
کامیت
266d67bda9
4فایلهای تغییر یافته به همراه18 افزوده شده و 2 حذف شده
  1. 6 0
      apps/impala/src/impala/conf.py
  2. 6 2
      apps/impala/src/impala/server.py
  3. 3 0
      desktop/conf.dist/hue.ini
  4. 3 0
      desktop/conf/pseudo-distributed.ini.tmpl

+ 6 - 0
apps/impala/src/impala/conf.py

@@ -46,6 +46,12 @@ SERVER_PORT = Config(
   default=21050,
   type=int)
 
+COORDINATOR_URL = Config(
+  key="coordinator_url",
+  help=_t("URL of the Impala Coordinator Server."),
+  type=str,
+  default="")
+
 IMPALA_PRINCIPAL=Config(
   key='impala_principal',
   help=_t("Kerberos principal name for Impala. Typically 'impala/hostname.foo.com'."),

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

@@ -28,7 +28,7 @@ from beeswax.server.hive_server2_lib import HiveServerClient
 
 from ImpalaService import ImpalaHiveServer2Service
 from impala.impala_flags import get_webserver_certificate_file, is_webserver_spnego_enabled, is_kerberos_enabled
-from impala.conf import DAEMON_API_USERNAME, DAEMON_API_PASSWORD
+from impala.conf import DAEMON_API_USERNAME, DAEMON_API_PASSWORD, COORDINATOR_URL
 
 
 LOG = logging.getLogger(__name__)
@@ -42,7 +42,11 @@ def get_api(user, url):
 
 def _get_impala_server_url(session):
   properties = session.get_properties()
-  http_addr = properties.get('coordinator_host', properties.get('http_addr'))
+  http_addr = ""
+  if COORDINATOR_URL.get():
+    http_addr = COORDINATOR_URL.get()
+  else:
+    http_addr = properties.get('coordinator_host', properties.get('http_addr'))
   http_addr = http_addr.replace('http://', '').replace('https://', '')
   return ('https://' if get_webserver_certificate_file() else 'http://') + http_addr
 

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -1309,6 +1309,9 @@
   # Port of the Impala Server
   ## server_port=21050
 
+  # URL of the Impala Coordinator Server.
+  ## coordinator_url=localhost:25000
+
   # Kerberos principal
   ## impala_principal=impala/hostname.foo.com
 

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -1294,6 +1294,9 @@
   # Port of the Impala Server
   ## server_port=21050
 
+  # URL of the Impala Coordinator Server.
+  ## coordinator_url=localhost:25000
+
   # Kerberos principal
   ## impala_principal=impala/hostname.foo.com