浏览代码

[impala] Backward compatibility by using HS2 port if no interface is specified

If no interface specified and port is beeswax, switch port to HS2 default as we want
to use HS2 from now on an HS2 is the default
Romain Rigaux 12 年之前
父节点
当前提交
6ccb8f2
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      apps/beeswax/src/beeswax/server/dbms.py

+ 7 - 1
apps/beeswax/src/beeswax/server/dbms.py

@@ -53,10 +53,16 @@ def get(user, query_server=None):
 def get_query_server_config(name='beeswax'):
   if name == 'impala':
     from impala.conf import SERVER_HOST, SERVER_PORT, IMPALA_PRINCIPAL, SERVER_INTERFACE as IMPALA_SERVER_INTERFACE
+    # Backward compatibility until Hue 3.0
+    # If no interface specified and port is beeswax, switch port to HS2 default as we want to use HS2 from now on
+    if IMPALA_SERVER_INTERFACE.get() == 'hiveserver2' and SERVER_PORT.get() == 21000:
+      port = 21050
+    else:
+      port = SERVER_PORT.get()
     query_server = {
         'server_name': 'impala',
         'server_host': SERVER_HOST.get(),
-        'server_port': SERVER_PORT.get(),
+        'server_port': port,
         'server_interface': IMPALA_SERVER_INTERFACE.get(),
         'principal': IMPALA_PRINCIPAL.get(),
     }