本文整理了Java中com.hazelcast.jet.Job.resume()
方法的一些代码示例,展示了Job.resume()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.resume()
方法的具体详情如下:
包路径:com.hazelcast.jet.Job
类名称:Job
方法名:resume
[英]Resumes a #suspend job. The job will resume from the last known successful snapshot, if there is one.
If the job is not suspended, it does nothing.
[中]恢复暂停工作。作业将从上次已知的成功快照(如果有)恢复。
如果作业未暂停,则不会执行任何操作。
代码示例来源:origin: hazelcast/hazelcast-jet-code-samples
job.resume();
waitForStatus(job, JobStatus.RUNNING);
代码示例来源:origin: hazelcast/hazelcast-jet
@Command(
description = "Resumes a suspended job"
)
public void resume(
@Parameters(index = "0",
paramLabel = "<job name or id>",
description = "Name of the job to resume")
String name
) throws IOException {
runWithJet(jet -> {
Job job = getJob(jet, name);
if (job.getStatus() != JobStatus.SUSPENDED) {
throw new RuntimeException("Job '" + name + "' is not suspended. Current state: " + job.getStatus());
}
println("Resuming job " + formatJob(job) + "...");
job.resume();
waitForJobStatus(job, JobStatus.RUNNING);
println("Job was successfully resumed.");
});
}
内容来源于网络,如有侵权,请联系作者删除!