소스 검색

[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 13 년 전
부모
커밋
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(),
     }