Browse Source

Revert "HUE-2664 [jobbrowser] Fix fetching logs from job history server"

This reverts commit b7b7ba59a70467c4d557704189f8e7521d812930.

When we click on log icon to the left of Job_id in Jobbrowser, it is always showing
the Application Master logs instead of the Task attempt logs. Reverting this commit
fixes the issue.
krish 10 năm trước cách đây
mục cha
commit
e1a3b52
1 tập tin đã thay đổi với 4 bổ sung11 xóa
  1. 4 11
      apps/jobbrowser/src/jobbrowser/yarn_models.py

+ 4 - 11
apps/jobbrowser/src/jobbrowser/yarn_models.py

@@ -28,7 +28,6 @@ from django.utils.translation import ugettext as _
 from desktop.lib.rest.resource import Resource
 from desktop.lib.view_util import format_duration_in_millis
 
-from hadoop.conf import YARN_CLUSTERS
 from hadoop.yarn.clients import get_log_client
 
 from jobbrowser.models import format_unixtime_ms
@@ -352,16 +351,10 @@ class Attempt:
     attempt = self.task.job.job_attempts['jobAttempt'][-1]
     log_link = attempt['logsLink']
     # Get MR task logs
-
-    # Don't hack up the urls if they've been migrated to the job history server.
-    for cluster in YARN_CLUSTERS.get().itervalues():
-      if log_link.startswith(cluster.HISTORY_SERVER_API_URL.get()):
-        break
-    else:
-      if self.assignedContainerId:
-        log_link = log_link.replace(attempt['containerId'], self.assignedContainerId)
-      if hasattr(self, 'nodeHttpAddress'):
-        log_link = log_link.replace(attempt['nodeHttpAddress'].split(':')[0], self.nodeHttpAddress.split(':')[0])
+    if self.assignedContainerId:
+      log_link = log_link.replace(attempt['containerId'], self.assignedContainerId)
+    if hasattr(self, 'nodeHttpAddress'):
+      log_link = log_link.replace(attempt['nodeHttpAddress'].split(':')[0], self.nodeHttpAddress.split(':')[0])
 
     for name in ('stdout', 'stderr', 'syslog'):
       link = '/%s/' % name