本文整理汇总了Python中apache.thermos.common.ckpt.CheckpointDispatcher.iter_statuses方法的典型用法代码示例。如果您正苦于以下问题:Python CheckpointDispatcher.iter_statuses方法的具体用法?Python CheckpointDispatcher.iter_statuses怎么用?Python CheckpointDispatcher.iter_statuses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apache.thermos.common.ckpt.CheckpointDispatcher
的用法示例。
在下文中一共展示了CheckpointDispatcher.iter_statuses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_states
# 需要导入模块: from apache.thermos.common.ckpt import CheckpointDispatcher [as 别名]
# 或者: from apache.thermos.common.ckpt.CheckpointDispatcher import iter_statuses [as 别名]
def get_states(self, task_id):
"""Returns the (timestamp, status) tuples of the task or [] if could not replay."""
statuses = CheckpointDispatcher.iter_statuses(self._runner_ckpt(task_id))
try:
return [(state.timestamp_ms / 1000.0, state.state) for state in statuses]
except CheckpointDispatcher.ErrorRecoveringState:
return []