Batch.retry ()


Batch.retry ()

重试( )

此方法指示群集管理器对失败或中止的批处理请求重试优化,将其状态更改为提交.请参阅批处理状态码部分获取更多详细信息。

使用示例:

Starttime = time.time() while batch。BatchStatus = =伽马线暴。BATCH_SUBMITTED: # Abort this batch if it is taking too long curtime = time.time() if curtime - starttime > maxwaittime: batch. Abort () break # Wait for two seconds time.sleep() # Update the resident attribute cache of the batch object with # latest values from cluster manager. #更新集群管理器中的最新值。batch.update() #如果批处理失败,我们在batch中重试。BatchStatus = =伽马线暴。BATCH_FAILED: batch.retry ()