Просмотр исходного кода

HUE-5684 [oozie] Hide workflow graph when node count > 30

Higher node count currently has two issues
1. It is not readable at all as the nodes are overlapping
2. It's effecting the load time of the page
krish 8 лет назад
Родитель
Сommit
64aa36f
2 измененных файлов с 5 добавлено и 3 удалено
  1. 2 3
      apps/oozie/src/oozie/models2.py
  2. 3 0
      apps/oozie/src/oozie/views/dashboard.py

+ 2 - 3
apps/oozie/src/oozie/models2.py

@@ -24,7 +24,6 @@ import uuid
 
 from datetime import datetime, timedelta
 from dateutil.parser import parse
-from sets import Set
 from string import Template
 from xml.sax.saxutils import escape
 
@@ -264,7 +263,7 @@ class Workflow(Job):
 
     _update_adj_list(adj_list)
 
-    nodes_uuid_set = Set()
+    nodes_uuid_set = set()
     wf_rows = _create_workflow_layout(node_hierarchy, adj_list, nodes_uuid_set)
 
     data = {'layout': [{}], 'workflow': {}}
@@ -272,7 +271,7 @@ class Workflow(Job):
       data['layout'][0]['rows'] = wf_rows
 
     wf_nodes = []
-    nodes_uuid_set = Set()
+    nodes_uuid_set = set()
     _dig_nodes(node_hierarchy, adj_list, user, wf_nodes, nodes_uuid_set)
     data['workflow']['nodes'] = wf_nodes
     data['workflow']['id'] = '123'

+ 3 - 0
apps/oozie/src/oozie/views/dashboard.py

@@ -356,6 +356,9 @@ def list_oozie_workflow(request, job_id):
       if not workflow_data.get('layout') or oozie_workflow.conf_dict.get('submit_single_action'):
         try:
           workflow_data = Workflow.gen_workflow_data_from_xml(request.user, oozie_workflow)
+          # Hide graph tab when node count > 30
+          if workflow_data.get('workflow') and len(workflow_data.get('workflow')['nodes']) > 30:
+            workflow_data = {}
         except Exception, e:
           LOG.exception('Graph data could not be generated from Workflow %s: %s' % (oozie_workflow.id, e))
   else: