当前位置: 首页>>代码示例>>Python>>正文


Python models.JobLinkage类代码示例

本文整理汇总了Python中jobbrowser.models.JobLinkage的典型用法代码示例。如果您正苦于以下问题:Python JobLinkage类的具体用法?Python JobLinkage怎么用?Python JobLinkage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JobLinkage类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: single_task_attempt_logs

def single_task_attempt_logs(request, jobid, taskid, attemptid):
  """
  We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/logs
  """
  job_link = JobLinkage(request.jt, jobid)
  task = job_link.get_task(taskid)
  try:
    attempt = task.get_attempt(attemptid)
  except KeyError:
    raise KeyError(_("Cannot find attempt '%(id)s' in task") % dict(id=attemptid))

  try:
    # Add a diagnostic log
    diagnostic_log = ", ".join(task.diagnosticMap[attempt.attemptId])
    logs = [ diagnostic_log ]
    # Add remaining logs
    logs += [ section.strip() for section in attempt.get_task_log() ]
  except TaskTrackerNotFoundException:
    # Four entries,
    # for diagnostic, stdout, stderr and syslog
    logs = [ _("Failed to retrieve log. TaskTracker not found.") ] * 4
  return render("attempt_logs.mako", request,
    {
      "attempt":attempt,
      "taskid":taskid,
      "joblnk": job_link,
      "task": task,
      "logs": logs
    })
开发者ID:DatalakeInc,项目名称:hortonworks-sandbox,代码行数:29,代码来源:views.py

示例2: single_task

def single_task(request, jobid, taskid):
    """
  We get here from /jobs/jobid/tasks/taskid
  """
    job_link = JobLinkage(request.jt, jobid)
    task = job_link.get_task(taskid)

    return render("task.mako", request, {'task': task, 'joblnk': job_link})
开发者ID:acnithin,项目名称:hue,代码行数:8,代码来源:views.py

示例3: task_attempt_counters

def task_attempt_counters(request, jobid, taskid, attemptid):
  """
  We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/counters
  (phew!)
  """
  job_link = JobLinkage(request.jt, jobid)
  task = job_link.get_task(taskid)
  attempt = task.get_attempt(attemptid)
  counters = {}
  if attempt:
    counters = attempt.counters
  return render("counters.html", request, {'counters':counters})
开发者ID:DatalakeInc,项目名称:hortonworks-sandbox,代码行数:12,代码来源:views.py

示例4: single_task_attempt

def single_task_attempt(request, jobid, taskid, attemptid):
    """
  We get here from /jobs/jobid/tasks/taskid/attempts/attemptid
  """
    job_link = JobLinkage(request.jt, jobid)
    task = job_link.get_task(taskid)
    try:
        attempt = task.get_attempt(attemptid)
    except KeyError:
        raise KeyError(_("Cannot find attempt '%(id)s' in task") % dict(id=attemptid))

    return render("attempt.mako", request, {"attempt": attempt, "taskid": taskid, "joblnk": job_link, "task": task})
开发者ID:shreepadma,项目名称:hue,代码行数:12,代码来源:views.py

示例5: single_task_attempt

def single_task_attempt(request, jobid, taskid, attemptid):
  """
  We get here from /jobs/jobid/tasks/taskid/attempts/attemptid
  """
  job_link = JobLinkage(request.jt, jobid)
  task = job_link.get_task(taskid)
  try:
    attempt = task.get_attempt(attemptid)
  except KeyError:
    raise KeyError("Cannot find attempt '%s' in task" % (attemptid,))

  logs = [ section.strip() for section in attempt.get_task_log() ]
  return render("attempt.mako", request,
    {
      "attempt":attempt,
      "taskid":taskid,
      "joblnk": job_link,
      "task": task,
      "logs": logs
    })
开发者ID:abayer,项目名称:hue,代码行数:20,代码来源:views.py

示例6: single_task_attempt

def single_task_attempt(request, jobid, taskid, attemptid):
  """
  We get here from /jobs/jobid/tasks/taskid/attempts/attemptid
  """
  job_link = JobLinkage(request.jt, jobid)
  task = job_link.get_task(taskid)
  try:
    attempt = task.get_attempt(attemptid)
  except KeyError:
    raise KeyError("Cannot find attempt '%s' in task" % (attemptid,))

  try:
    logs = [ section.strip() for section in attempt.get_task_log() ]
  except TaskTrackerNotFoundException:
    # Three entries for stdout, stderr and syslog
    logs = [ "Failed to retrieve log. TaskTracker not found." ] * 3
  return render("attempt.mako", request,
    {
      "attempt":attempt,
      "taskid":taskid,
      "joblnk": job_link,
      "task": task,
      "logs": logs
    })
开发者ID:ConduitTeam,项目名称:hue,代码行数:24,代码来源:views.py


注:本文中的jobbrowser.models.JobLinkage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。