Selaa lähdekoodia

HUE-8758 [connectors] Fix Hive Server test connections

Avoid calling Oozie all the time in the Oozie agnostic scheduler API.
(no-op as WIP and flagged off)

Found descrepancy with old Kudu table auto detection, added a comment
and to simplify in the future.
Romain 5 vuotta sitten
vanhempi
commit
3b929d25a6

+ 7 - 4
apps/beeswax/src/beeswax/api.py

@@ -665,10 +665,13 @@ def get_sample_data(request, database, table, column=None):
 
 
 def _get_sample_data(db, database, table, column, is_async=False, cluster=None, operation=None):
-  table_obj = db.get_table(database, table)
-  if table_obj.is_impala_only and db.client.query_server['server_name'] != 'impala':
-    query_server = get_query_server_config('impala', connector=cluster)
-    db = dbms.get(db.client.user, query_server, cluster=cluster)
+  if operation == 'hello':
+    table_obj = None
+  else:
+    table_obj = db.get_table(database, table)
+    if table_obj.is_impala_only and db.client.query_server['server_name'] != 'impala':  # Kudu table, now Hive should support it though
+      query_server = get_query_server_config('impala', connector=cluster)
+      db = dbms.get(db.client.user, query_server, cluster=cluster)
 
   sample_data = db.get_sample(database, table_obj, column, generate_sql_only=is_async, operation=operation)
   response = {'status': -1}

+ 2 - 2
apps/jobbrowser/src/jobbrowser/apis/workflow_api.py

@@ -30,8 +30,8 @@ LOG = logging.getLogger(__name__)
 try:
   from oozie.forms import ParameterForm
   from oozie.conf import OOZIE_JOBS_COUNT, ENABLE_OOZIE_BACKEND_FILTERING
-  from oozie.views.dashboard import get_oozie_job_log, list_oozie_workflow, manage_oozie_jobs, bulk_manage_oozie_jobs, has_dashboard_jobs_access, massaged_oozie_jobs_for_json, \
-      has_job_edition_permission
+  from oozie.views.dashboard import get_oozie_job_log, list_oozie_workflow, manage_oozie_jobs, bulk_manage_oozie_jobs, \
+      has_dashboard_jobs_access, massaged_oozie_jobs_for_json, has_job_edition_permission
   has_oozie_installed = True
 except Exception as e:
   LOG.warn('Some applications are not enabled for Job Browser v2: %s' % e)

+ 1 - 1
desktop/core/src/desktop/js/ko/components/ko.jobBrowserLinks.js

@@ -127,7 +127,7 @@ class JobBrowserPanel {
     let lastScheduleBrowserRequest = undefined;
     const checkScheduleBrowserStatus = function() {
       return $.post(
-        '/jobbrowser/api/jobs',
+        '/desktop/api/schedule/list',
         {
           interface: ko.mapping.toJSON('schedules'),
           filters: ko.mapping.toJSON([

+ 4 - 0
desktop/core/src/desktop/lib/scheduler/api.py

@@ -37,6 +37,10 @@ except Exception as e:
   LOG.warn('Oozie application is not enabled: %s' % e)
 
 
+def list_schedules(request):
+  return JsonResponse({})
+
+
 def new_schedule(request):
   return new_coordinator(request)
 

+ 1 - 0
desktop/core/src/desktop/lib/scheduler/urls.py

@@ -24,4 +24,5 @@ urlpatterns = [
   url(r'^api/schedule/new/?$', api.get_schedule, name='scheduler.api.new_schedule'),
   url(r'^api/schedule/edit/?$', api.get_schedule, name='scheduler.api.edit_schedule'),
   url(r'^api/schedule/submit/(?P<doc_id>[-\w]+)?$', api.submit_schedule, name='scheduler.api.submit_schedule'),
+  url(r'^api/schedule/list/?$', api.list_schedules, name='scheduler.api.list_schedules'),
 ]

+ 1 - 1
desktop/libs/notebook/src/notebook/conf.py

@@ -342,7 +342,7 @@ def config_validator(user, interpreters=None):
         data = json.loads(response.content)
 
         if data['status'] != 0:
-          raise Exception(data['message'])
+          raise Exception(data)
       except Exception as e:
         trace = str(e)
         msg = "Testing the connector connection failed."