Browse Source

HUE-8591 [cluster] Add logic to get the corresponding Impalad name

Romain Rigaux 7 years ago
parent
commit
db993bb
2 changed files with 3 additions and 1 deletions
  1. 2 1
      apps/beeswax/src/beeswax/server/dbms.py
  2. 1 0
      desktop/core/src/desktop/api2.py

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

@@ -79,7 +79,8 @@ def get(user, query_server=None, cluster=None):
 def get_query_server_config(name='beeswax', server=None, cluster=None):
   if cluster and cluster != CLUSTER_ID.get():
     if cluster and 'altus:dataware:k8s' in cluster:
-      cluster_config = {'server_host': 'impala-coordinatortim', 'name': cluster}
+      name = re.search('cluster:(.+?)/', cluster).group(1)
+      cluster_config = {'server_host': 'impala-coordinator' + name, 'name': cluster}
     else:
       cluster_config = Cluster(user=None).get_config(cluster)
   else:

+ 1 - 0
desktop/core/src/desktop/api2.py

@@ -160,6 +160,7 @@ def get_context_computes(request, interface):
           'name': cluster.get('clusterName'),
           'status': cluster.get('status'),
           'namespace': cluster.get('namespaceCrn', cluster.get('crn')),
+          'impalad_host': IS_K8_ONLY.get() and '%(publicHost)s' % cluster['coordinatorEndpoint'] or '',
           'type': 'altus-dw'
         } for cluster in dw_clusters if (cluster.get('status') == 'CREATED' and cluster.get('cdhVersion') >= 'CDH515') or IS_K8_ONLY.get()]
       )