Details
-
Type: Improvement
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 2.2.0
-
Fix Version/s: 2.5.0
-
Component/s: app.jobbrowser
-
Labels:None
-
Target Version:
Description
Instead of doing the above logic, we should check for the APP_ID status and route to the MR API or History Server API accordingly.
This would simply the code and have Oozie direct job log link work (as Oozie use job_XXXXXXXX format and not application_XXXXXXX)
""" Try first as if it was a running job, then as a finished job. """ try: if jobid.startswith('application'): json = self.mapreduce_api.job(self.user, jobid.replace('application', 'job')) return YarnJob(self.mapreduce_api, json['job']) except Exception, e: LOG.info('Job %s not running: %s' % (jobid, e)) jobid = jobid.replace('application', 'job') json = self.history_server_api.job(self.user, jobid) return YarnJob(self.history_server_api, json['job'])