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


Python JobDB.setJobStatus方法代码示例

本文整理汇总了Python中DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB.setJobStatus方法的典型用法代码示例。如果您正苦于以下问题:Python JobDB.setJobStatus方法的具体用法?Python JobDB.setJobStatus怎么用?Python JobDB.setJobStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB的用法示例。


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

示例1: OptimizerModule

# 需要导入模块: from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB [as 别名]
# 或者: from DIRAC.WorkloadManagementSystem.DB.JobDB.JobDB import setJobStatus [as 别名]

#.........这里部分代码省略.........
    return self.jobDB.setJobOptParameter(job, reportName, str(value))

  #############################################################################
  def setOptimizerChain(self, job, value):
    """This method sets the job optimizer chain, in principle only needed by
       one of the optimizers.
    """
    self.log.verbose("self.jobDB.setOptimizerChain(%s,%s)" % (job, value))
    if not self.am_Enabled():
      return S_OK()
    return self.jobDB.setOptimizerChain(job, value)

  #############################################################################
  def setNextOptimizer(self, job):
    """This method is executed when the optimizer instance has successfully
       processed the job.  The next optimizer in the chain will subsequently
       start to work on the job.
    """

    result = self.logDB.addLoggingRecord(job, status=self.startingMajorStatus,
                                         minor=self.startingMinorStatus,
                                         source=self.am_getModuleParam("optimizerName"))
    if not result['OK']:
      self.log.warn(result['Message'])

    self.log.verbose("self.jobDB.setNextOptimizer(%s,'%s')" % (job, self.am_getModuleParam("optimizerName")))
    return self.jobDB.setNextOptimizer(job, self.am_getModuleParam("optimizerName"))

  #############################################################################
  def updateJobStatus(self, job, status, minorStatus=None, appStatus=None):
    """This method updates the job status in the JobDB, this should only be
       used to fail jobs due to the optimizer chain.
    """
    self.log.verbose("self.jobDB.setJobStatus(%s,'Status/Minor/Application','%s'/'%s'/'%s',update=True)" %
                     (job, status, str(minorStatus), str(appStatus)))
    if not self.am_Enabled():
      return S_OK()

    result = self.jobDB.setJobStatus(job, status, minorStatus, appStatus)
    if not result['OK']:
      return result

    result = self.logDB.addLoggingRecord(job, status=status, minor=minorStatus, application=appStatus,
                                         source=self.am_getModuleParam('optimizerName'))
    if not result['OK']:
      self.log.warn(result['Message'])

    return S_OK()

  #############################################################################
  def setJobParam(self, job, reportName, value):
    """This method updates a job parameter in the JobDB.
    """
    self.log.verbose("self.jobDB.setJobParameter(%s,'%s','%s')" % (job, reportName, value))
    if not self.am_Enabled():
      return S_OK()
    return self.jobDB.setJobParameter(job, reportName, value)

  #############################################################################
  def setFailedJob(self, job, msg, classAdJob=None):
    """This method moves the job to the failed status
    """
    self.log.verbose("self.updateJobStatus(%s,'%s','%s')" % (job, self.failedStatus, msg))
    if not self.am_Enabled():
      return S_OK()
    self.updateJobStatus(job, self.failedStatus, msg)
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:70,代码来源:OptimizerModule.py


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