
org.shoulder.batch.service.impl.ProgressAble Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shoulder-batch Show documentation
Show all versions of shoulder-batch Show documentation
Shoulder 扩展-批处理模块,提供批量数据导入、导出、异步校验、导入历史记录管理等能力。
package org.shoulder.batch.service.impl;
import org.shoulder.batch.model.BatchProgressRecord;
import java.util.function.BiConsumer;
/**
* 有进度的
*
* @author lym
*/
public interface ProgressAble {
void start();
void failStop();
void finish();
boolean hasFinish();
long calculateProcessedTime();
float calculateProgress();
long calculateTimeLeft();
/**
* 任务进度
*
* @return 进度
*/
BatchProgressRecord getBatchProgress();
String getTaskId();
/**
* 完成第 partIndex 个分片
*
* @param partIndex 分片标
*/
void finishPart(int partIndex);
/**
* 结束后的回调
*/
default void onFinished(String id, ProgressAble task) {
}
void setTotal(int total);
void setOnFinishCallback(BiConsumer onFinishedCallback);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy