本文整理汇总了Golang中github.com/hashicorp/nomad/nomad/structs.Evaluation.Copy方法的典型用法代码示例。如果您正苦于以下问题:Golang Evaluation.Copy方法的具体用法?Golang Evaluation.Copy怎么用?Golang Evaluation.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/hashicorp/nomad/nomad/structs.Evaluation
的用法示例。
在下文中一共展示了Evaluation.Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: setStatus
// setStatus is used to update the status of the evaluation
func setStatus(logger *log.Logger, planner Planner, eval, nextEval *structs.Evaluation, status, desc string) error {
logger.Printf("[DEBUG] sched: %#v: setting status to %s", eval, status)
newEval := eval.Copy()
newEval.Status = status
newEval.StatusDescription = desc
if nextEval != nil {
newEval.NextEval = nextEval.ID
}
return planner.UpdateEval(newEval)
}
示例2: setStatus
// setStatus is used to update the status of the evaluation
func setStatus(logger *log.Logger, planner Planner,
eval, nextEval, spawnedBlocked *structs.Evaluation,
tgMetrics map[string]*structs.AllocMetric, status, desc string) error {
logger.Printf("[DEBUG] sched: %#v: setting status to %s", eval, status)
newEval := eval.Copy()
newEval.Status = status
newEval.StatusDescription = desc
newEval.FailedTGAllocs = tgMetrics
if nextEval != nil {
newEval.NextEval = nextEval.ID
}
if spawnedBlocked != nil {
newEval.BlockedEval = spawnedBlocked.ID
}
return planner.UpdateEval(newEval)
}