def fetch_result(self, notebook, snippet, rows, start_over): job_id = snippet['result']['handle']['id'] oozie_workflow = check_job_access_permission(MockRequest(self.user, self.fs, self.jt), job_id) output = get_workflow_output(oozie_workflow, self.fs) return { 'data': [hdfs_link(output)], 'meta': [{'name': 'Header', 'type': 'STRING_TYPE', 'comment': ''}], 'type': 'text' }
def watch(request, job_id): oozie_workflow = check_job_access_permission(request, job_id) logs, workflow_actions, is_really_done = api.get( request.fs, request.jt, request.user).get_log(request, oozie_workflow) output = get_workflow_output(oozie_workflow, request.fs) workflow = { 'job_id': oozie_workflow.id, 'status': oozie_workflow.status, 'progress': oozie_workflow.get_progress(), 'isRunning': oozie_workflow.is_running(), 'killUrl': reverse('oozie:manage_oozie_jobs', kwargs={ 'job_id': oozie_workflow.id, 'action': 'kill' }), 'rerunUrl': reverse('oozie:rerun_oozie_job', kwargs={ 'job_id': oozie_workflow.id, 'app_path': urllib.parse.quote(oozie_workflow.appPath.encode('utf-8'), safe=SAFE_CHARACTERS_URI_COMPONENTS) }), 'actions': workflow_actions } response = { 'workflow': workflow, 'logs': logs, 'isReallyDone': is_really_done, 'output': hdfs_link(output) } return JsonResponse(response, content_type="text/plain")
def watch(request, job_id): oozie_workflow = check_job_access_permission(request, job_id) logs, workflow_actions = api.get(request, job_id).get_log(request, oozie_workflow) output = get_workflow_output(oozie_workflow, request.fs) workflow = { "job_id": oozie_workflow.id, "status": oozie_workflow.status, "progress": oozie_workflow.get_progress(), "isRunning": oozie_workflow.is_running(), "killUrl": reverse("oozie:manage_oozie_jobs", kwargs={"job_id": oozie_workflow.id, "action": "kill"}), "rerunUrl": reverse( "oozie:rerun_oozie_job", kwargs={"job_id": oozie_workflow.id, "app_path": oozie_workflow.appPath} ), "actions": workflow_actions, } response = {"workflow": workflow, "logs": logs, "output": hdfs_link(output)} return HttpResponse(json.dumps(response), content_type="text/plain")
def watch(request, job_id): oozie_workflow = check_job_access_permission(request, job_id) logs, workflow_actions, is_really_done = api.get( request.jt, request.jt, request.user).get_log(request, oozie_workflow) output = get_workflow_output(oozie_workflow, request.fs) workflow = { 'job_id': oozie_workflow.id, 'status': oozie_workflow.status, 'progress': oozie_workflow.get_progress(), 'isRunning': oozie_workflow.is_running(), 'killUrl': reverse('oozie:manage_oozie_jobs', kwargs={ 'job_id': oozie_workflow.id, 'action': 'kill' }), 'rerunUrl': reverse('oozie:rerun_oozie_job', kwargs={ 'job_id': oozie_workflow.id, 'app_path': oozie_workflow.appPath }), 'actions': workflow_actions } response = { 'workflow': workflow, 'logs': logs, 'isReallyDone': is_really_done, 'output': hdfs_link(output) } return HttpResponse(json.dumps(response), content_type="text/plain")
def watch(request, job_id): oozie_workflow = check_job_access_permission(request, job_id) logs, workflow_actions = api.get(request.jt, request.jt, request.user).get_log(request, oozie_workflow) output = get_workflow_output(oozie_workflow, request.fs) workflow = { 'job_id': oozie_workflow.id, 'status': oozie_workflow.status, 'progress': oozie_workflow.get_progress(), 'isRunning': oozie_workflow.is_running(), 'killUrl': reverse('oozie:manage_oozie_jobs', kwargs={'job_id': oozie_workflow.id, 'action': 'kill'}), 'rerunUrl': reverse('oozie:rerun_oozie_job', kwargs={'job_id': oozie_workflow.id, 'app_path': oozie_workflow.appPath}), 'actions': workflow_actions } response = { 'workflow': workflow, 'logs': logs, 'output': hdfs_link(output) } return HttpResponse(json.dumps(response), content_type="text/plain")