소스 검색

[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 년 전
부모
커밋
28be8c8
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)