浏览代码

[oozie] Order coordinator actions on the Oozie side

https://github.com/cloudera/hue/pull/132

Oozie configuration can have 'oozie.coord.actions.default.length' parameter which overloads oozie 'len'
param, and Hue may not display latest coordinator actions if they are exceeding this value.
Since https://issues.apache.org/jira/browse/OOZIE-1754 oozie can sort coordinator actions.
We need to request oozie to sort coordinator actions in descending order and display them
correctly by dashboard.py.
alheio 11 年之前
父节点
当前提交
28be8c8bb7
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 4 1
      apps/oozie/src/oozie/views/dashboard.py
  2. 1 0
      desktop/libs/liboozie/src/liboozie/oozie_api.py

+ 4 - 1
apps/oozie/src/oozie/views/dashboard.py

@@ -740,7 +740,10 @@ def massaged_coordinator_actions_for_json(coordinator, oozie_bundle):
       'missingDependencies': action.missingDependencies
     }
 
-    actions.insert(0, massaged_action)
+    actions.append(massaged_action)
+
+  # Sorting for Oozie < 4.1 backward compatibility
+  actions.sort(key=lambda k: k['number'], reverse=True)
 
   return actions
 

+ 1 - 0
desktop/libs/liboozie/src/liboozie/oozie_api.py

@@ -160,6 +160,7 @@ class OozieApi(object):
   def get_coordinator(self, jobid):
     params = self._get_params()
     params.update({'len': -1})
+    params.update({'order': 'desc'})
     resp = self._root.get('job/%s' % (jobid,), params)
     return Coordinator(self, resp)