spring-batch - 暂停和恢复作业执行 Spring Batch
问题描述
有同样的问题在这里问 -
我在春天检查了 BatchStatus 枚举,没有可用的状态 PAUSED,它仅作为用例提供,此处没有详细信息 -
解决方案
为此使用作业运算符,它是提供停止、重新启动、getStatus 等功能的基本接口
public interface JobOperator {
List<Long> getExecutions(long instanceId) throws NoSuchJobInstanceException;
List<Long> getJobInstances(String jobName, int start, int count)
throws NoSuchJobException;
Set<Long> getRunningExecutions(String jobName) throws NoSuchJobException;
String getParameters(long executionId) throws NoSuchJobExecutionException;
Long start(String jobName, String parameters)
throws NoSuchJobException, JobInstanceAlreadyExistsException;
Long restart(long executionId)
throws JobInstanceAlreadyCompleteException, NoSuchJobExecutionException,
NoSuchJobException, JobRestartException;
Long startNextInstance(String jobName)
throws NoSuchJobException, JobParametersNotFoundException, JobRestartException,
JobExecutionAlreadyRunningException, JobInstanceAlreadyCompleteException;
boolean stop(long executionId)
throws NoSuchJobExecutionException, JobExecutionNotRunningException;
String getSummary(long executionId) throws NoSuchJobExecutionException;
Map<Long, String> getStepExecutionSummaries(long executionId)
throws NoSuchJobExecutionException;
Set<String> getJobNames();
}
这是一个例子
推荐阅读
- vue.js - 如何在 Vue 中设置 devserver 代理,但让它忽略本地 php 文件?
- excel - 如何添加新工作表并使用它在 vba 中粘贴表格
- node.js - 在 nodejs 上使用护照文档
- python - 随着更多线程的运行,Tkinter Gui 有时会冻结
- angular - Angular 2 自定义验证器不调用后端
- nvidia - 如何让 Steam 在 Ubuntu 20.04 上运行
- sql - PostgreSQL ltree 查找给定路径的所有子节点(不使用表达式)
- ios - 键盘隐藏时,键盘上方的工具栏不会隐藏
- java - 从单元测试类访问公共静态最终变量
- assembly - MIPS 双递归问题“无法将堆栈段扩展 16 字节至 524288 字节”