-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加async processor支持。IBatchConsumer的接口参数修改为Collection类型
- Loading branch information
1 parent
932e440
commit f22bb14
Showing
41 changed files
with
611 additions
and
122 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
nop-batch/nop-batch-core/src/main/java/io/nop/batch/core/BatchConfigs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.nop.batch.core; | ||
|
||
import io.nop.api.core.annotations.core.Description; | ||
import io.nop.api.core.config.IConfigReference; | ||
import io.nop.api.core.util.SourceLocation; | ||
|
||
import java.time.Duration; | ||
|
||
import static io.nop.api.core.config.AppConfig.varRef; | ||
|
||
public interface BatchConfigs { | ||
SourceLocation s_loc = SourceLocation.fromClass(BatchConfigs.class); | ||
|
||
@Description("异步Processor执行的缺省超时时间") | ||
IConfigReference<Duration> CFG_BATCH_ASYNC_PROCESS_TIMEOUT = varRef(s_loc, "nop.batch.async-process-timeout", | ||
Duration.class, Duration.ofMinutes(10)); // 缺省为10分钟 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
nop-batch/nop-batch-core/src/main/java/io/nop/batch/core/IBatchRecordSnapshotBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package io.nop.batch.core; | ||
|
||
import java.util.List; | ||
import java.util.Collection; | ||
|
||
public interface IBatchRecordSnapshotBuilder<S> { | ||
interface ISnapshot<S> { | ||
List<S> restore(List<S> items, IBatchChunkContext chunkContext); | ||
Collection<S> restore(Collection<S> items, IBatchChunkContext chunkContext); | ||
|
||
void onError(Throwable e); | ||
} | ||
|
||
ISnapshot<S> buildSnapshot(List<S> items, IBatchChunkContext chunkContext); | ||
ISnapshot<S> buildSnapshot(Collection<S> items, IBatchChunkContext chunkContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.