Java 类org.springframework.batch.core.launch.support.RunIdIncrementer 实例源码
项目:composed-task-runner
文件:ComposedRunnerJobFactory.java
@Override
public Job getObject() throws Exception {
ComposedRunnerVisitor composedRunnerVisitor = new ComposedRunnerVisitor();
TaskParser taskParser = new TaskParser("composed-task-runner",
this.dsl,false,true);
taskParser.parse().accept(composedRunnerVisitor);
this.visitorDeque = composedRunnerVisitor.getFlow();
FlowJobBuilder builder = this.jobBuilderFactory
.get(this.taskNameResolver.getTaskName())
.start(this.flowBuilder
.start(createFlow())
.end())
.end();
if(this.incrementInstanceEnabled) {
builder.incrementer(new RunIdIncrementer());
}
return builder.build();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecutionOnNonRestartableJob() throws Exception {
this.job = this.jobs.get("job").preventRestart()
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
// A failed job that is not restartable does not re-use the job params of
// the last execution, but creates a new job instance when running it again.
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(2);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecutionWithNonIdentifyingParameters() throws Exception {
this.job = this.jobs.get("job")
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
JobParameters jobParameters = new JobParametersBuilder().addLong("id", 1L, false)
.addLong("foo", 2L, false).toJobParameters();
this.runner.execute(this.job, jobParameters);
this.runner.execute(this.job, jobParameters);
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(1);
}
项目:spring-boot-concourse
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecutionOnNonRestartableJob() throws Exception {
this.job = this.jobs.get("job").preventRestart()
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
// A failed job that is not restartable does not re-use the job params of
// the last execution, but creates a new job instance when running it again.
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(2);
}
项目:spring-boot-concourse
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecutionWithNonIdentifyingParameters() throws Exception {
this.job = this.jobs.get("job")
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
JobParameters jobParameters = new JobParametersBuilder().addLong("id", 1L, false)
.addLong("foo", 2L, false).toJobParameters();
this.runner.execute(this.job, jobParameters);
this.runner.execute(this.job, jobParameters);
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(1);
}
项目:signature-processing
文件:BatchConfig.java
/**
* @return main job
*/
@Bean
public Job job() {
return jobs.get("mainJob")
.incrementer(new RunIdIncrementer())
.flow(loadProcessedListIds())
.next(new FlowBuilder<SimpleFlow>("splitFlow")
.start(loadScans())
.split(taskExecutor())
.add(new FlowBuilder<SimpleFlow>("loadTranscriptsFlow")
.start(loadTranscripts())
.build())
.build())
.next(addSign())
.end()
.build();
}
项目:contestparser
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecutionOnNonRestartableJob() throws Exception {
this.job = this.jobs.get("job").preventRestart()
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
// A failed job that is not restartable does not re-use the job params of
// the last execution, but creates a new job instance when running it again.
assertEquals(2, this.jobExplorer.getJobInstances("job", 0, 100).size());
}
项目:contestparser
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecutionWithNonIdentifyingParameters() throws Exception {
this.job = this.jobs.get("job")
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
JobParameters jobParameters = new JobParametersBuilder().addLong("id", 1L, false)
.addLong("foo", 2L, false).toJobParameters();
this.runner.execute(this.job, jobParameters);
this.runner.execute(this.job, jobParameters);
assertEquals(1, this.jobExplorer.getJobInstances("job", 0, 100).size());
}
项目:nixmash-blog
文件:DemoJobConfiguration.java
@Bean(name = "demoJob")
public Job demoJob() throws Exception {
return jobBuilderFactory.get("demoJob")
.incrementer(new RunIdIncrementer())
.listener(demoJobListener)
.flow(demoStep1())
.next(decideIfGoodToContinue())
.on(c(NO))
.end()
.on(c(YES))
.to(optionalStep())
.end()
.build();
}
项目:nixmash-blog
文件:GithubJobConfiguration.java
@Bean(name = "githubJob")
public Job githubJob() throws Exception {
return jobBuilderFactory.get("githubJob")
.incrementer(new RunIdIncrementer())
.listener(githubJobListener)
.flow(githubStep1())
.end()
.build();
}
项目:appstatus-spring-boot-starter
文件:OneConfig.java
/**
* Create job one.
*
* @return Job job one
*/
@Bean
public Job oneJob() {
return jobBuilderFactory.get("one-job") //
.incrementer(new RunIdIncrementer()) //
.listener(listener) //
.flow(oneStep()) //
.end() //
.build();
}
项目:batch-scheduler
文件:TaskletConfig.java
/**
* @jobName job名称
* 创建Job名称为jobName的任务
*/
public Job job(BatchRunConfDto conf, String jobName, String typeId, String scriptFile) {
Step step = stepOne(conf, jobName, typeId, scriptFile);
return jobBuilderFactory.get(jobName)
.incrementer(new RunIdIncrementer())
.start(step)
.build();
}
项目:hub-fortify-ssc-integration-service
文件:BlackDuckFortifyJobConfig.java
/**
* Create the job to push the vulnerability data from BlackDuck to Fortify Job
*
* @return Job
*/
@Bean
public Job pushBlackDuckScanToFortifyJob() {
logger.info("Push Blackduck Scan data to Fortify Job");
return jobBuilderFactory.get("Push Blackduck Scan data to Fortify Job")
.incrementer(new RunIdIncrementer())
.listener(this)
.flow(createMappingParserStep())
.end().build();
}
项目:oma-riista-web
文件:LHHuntingClubBatchConfig.java
@Bean(name = JOB_NAME)
public Job lhClubImportJob(
@Qualifier(DOWNLOAD_STEP) Step download,
@Qualifier(TRUNCATE_STEP) Step truncate,
@Qualifier(IMPORT_STEP) Step importStep,
@Qualifier(SYNCHRONIZE_STEP) Step synchronizeStep) {
return jobBuilderFactory.get(JOB_NAME)
.incrementer(new RunIdIncrementer())
.listener(new LHHuntingClubCSVCleaner())
.start(download)
.next(truncate)
.next(importStep)
.next(synchronizeStep)
.build();
}
项目:oma-riista-web
文件:InnofactorImportConfig.java
@Bean(name = JOB_NAME)
public Job innofactorImportJob(@Qualifier(STEP_NAME) Step innofactorImportStep) {
return jobBuilder.get(JOB_NAME)
.incrementer(new RunIdIncrementer())
.validator(MetsastajaRekisteriJobParameters.createValidator())
.start(innofactorImportStep)
.next(innofactorArchiveStep())
.next(innofactorPostProcessStep())
.build();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void incrementExistingExecution() throws Exception {
this.job = this.jobs.get("job").start(this.step)
.incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(2);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecution() throws Exception {
this.job = this.jobs.get("job")
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(1);
}
项目:TaskMadness
文件:MooreStatConfiguration.java
@Bean
public Job importUserJob(JobBuilderFactory jobs, Step s1, JobExecutionListener executionListener) {
return jobs.get("importUserJob")
.incrementer(new RunIdIncrementer())
.listener(executionListener)
.flow(s1)
.end()
.build();
}
项目:TaskMadness
文件:NcaaStatConfiguration.java
@Bean
public Job importUserJob(JobBuilderFactory jobs, Step s1, JobExecutionListener executionListener) {
return jobs.get("importUserJob")
.incrementer(new RunIdIncrementer())
.listener(executionListener)
.flow(s1)
.end()
.build();
}
项目:spring-playground
文件:Job1.java
@Bean
public Job job() {
return jobBuilderFactory.get("job1")
.incrementer(new RunIdIncrementer())
.flow(step1)
.end()
.build();
}
项目:spring-boot-concourse
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void incrementExistingExecution() throws Exception {
this.job = this.jobs.get("job").start(this.step)
.incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(2);
}
项目:spring-boot-concourse
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecution() throws Exception {
this.job = this.jobs.get("job")
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
assertThat(this.jobExplorer.getJobInstances("job", 0, 100)).hasSize(1);
}
项目:contestparser
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void incrementExistingExecution() throws Exception {
this.job = this.jobs.get("job").start(this.step)
.incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
assertEquals(2, this.jobExplorer.getJobInstances("job", 0, 100).size());
}
项目:contestparser
文件:JobLauncherCommandLineRunnerTests.java
@Test
public void retryFailedExecution() throws Exception {
this.job = this.jobs.get("job")
.start(this.steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
throw new RuntimeException("Planned");
}
}).build()).incrementer(new RunIdIncrementer()).build();
this.runner.execute(this.job, new JobParameters());
this.runner.execute(this.job, new JobParameters());
assertEquals(1, this.jobExplorer.getJobInstances("job", 0, 100).size());
}
项目:spring-batch
文件:BatchConfiguration.java
@Bean
public Job importTicketsJob(final JobBuilderFactory jobs,
final Step importTicketStep,
final TicketImportJobExecutionListener ticketImportJobExecutionListener) {
return jobs.get("importTicketsJob")
.incrementer(new RunIdIncrementer())
.listener(ticketImportJobExecutionListener)
.flow(importTicketStep)
.end()
.build();
}
项目:aws-elastic-beanstalk-worker-spring-boot-spring-batch-template
文件:SampleBatchApplication.java
@Bean(name="job1")
public Job job1() {
return jobs
.get("myJob")
.incrementer(new RunIdIncrementer())
.start(step1())
.next(step2(" hogehoge"))
.next(steps.get("step3").tasklet((stepContribution, chunkContext) -> {
System.out.println("step 3");
return RepeatStatus.FINISHED;}).build())
.build();
}
项目:aws-elastic-beanstalk-worker-spring-boot-spring-batch-template
文件:SampleBatchApplication.java
@Bean(name="job2")
public Job job2() {
SimpleJob job = new SimpleJob();
job.setRestartable(false);
return jobs
.get("myJob2")
.incrementer(new RunIdIncrementer())
.start(steps.get("step3").tasklet((stepContribution, chunkContext) -> {
System.out.println("job2 step");
return RepeatStatus.FINISHED;}).build())
.build();
}
项目:aws-elastic-beanstalk-worker-spring-boot-spring-batch-template
文件:SampleBatchApplication.java
@Bean(name="job3")
public Job job3() {
return jobs
.get("myJob")
.incrementer(new RunIdIncrementer())
.start(step1())
.next(step2(" job3 sample"))
.next(steps.get("step3").tasklet((stepContribution, chunkContext) -> {
System.out.println(chunkContext.getStepContext().getJobParameters().get("INPUT_FILE_PATH"));
System.out.println(chunkContext.getStepContext().getJobParameters().get("TIMESTAMP"));
System.out.println("step 3");
return RepeatStatus.FINISHED;}).build())
.build();
}
项目:json-file-itemwriter
文件:BatchConfiguration.java
@Bean
public Job writeStepJob(JobBuilderFactory jobs, Step stepOne, JobExecutionListener listener) {
return jobs.get("writeStepJob")
.incrementer(new RunIdIncrementer())
.listener(listener)
.flow(stepOne)
.end()
.build();
}
项目:json-file-itemwriter
文件:BatchConfiguration.java
@Bean
public Job writeJsonFormatJob(JobBuilderFactory jobs, Step stepOne, JobExecutionListener listener) {
return jobs.get("JsonWriter")
.incrementer(new RunIdIncrementer())
.listener(listener)
.flow(stepOne)
.end()
.build();
}
项目:json-file-itemwriter
文件:BatchConfiguration.java
@Bean
public Job writeStepJob(JobBuilderFactory jobs, Step stepOne, JobExecutionListener listener) {
return jobs.get("writeStepJob")
.incrementer(new RunIdIncrementer())
.listener(listener)
.flow(stepOne)
.end()
.build();
}
项目:marklogic-spring-batch
文件:YourTwoStepJobConfig.java
@Bean
public Job job(JobBuilderFactory jobBuilderFactory, Step step1, Step step2) {
return jobBuilderFactory.get(JOB_NAME)
.start(step1)
.next(step2)
.incrementer(new RunIdIncrementer())
.build();
}
项目:jplantuml
文件:PlantUmlConfig.java
@Bean
public Job plantUmlJob(JobBuilderFactory jobs, Step s1) {
return jobs.get("plantUmlJob")
.incrementer(new RunIdIncrementer())
.flow(s1)
.end()
.build();
}
项目:pinenut
文件:BatchConfiguration.java
@Bean
public Job job(Step step1) throws Exception {
return jobBuilderFactory.get("job1")
.incrementer(new RunIdIncrementer())
.start(step1)
.build();
}
项目:spring-batch-scheduler-example
文件:BatchConfiguration.java
/**
* This method declare the steps that the batch has to follow
*
* @param jobs
* @param s1
* @return
*/
@Bean
public Job importPerson(JobBuilderFactory jobs, Step s1) {
return jobs.get("import")
.incrementer(new RunIdIncrementer()) // because a spring config bug, this incrementer is not really useful
.flow(s1)
.end()
.build();
}
项目:spring-batch-tools
文件:TestJobConfig.java
@Bean
public Job testJob() {
final JobParametersIncrementer incrementer = new RunIdIncrementer();
return jobs.get(JOB_NAME) //
.incrementer(incrementer) //
.start(taskletStep()) //
.next(chunkStep()) //
.build();
}
项目:saos
文件:CtjImportJobConfiguration.java
@Bean
public Job ctJudgmentImportJob() {
return jobs.get("IMPORT_CT_JUDGMENTS")
.start(ctJudgmentImportDownloadStep())
.next(ctJudgmentImportProcessStep())
.incrementer(new RunIdIncrementer())
.build();
}
项目:saos
文件:TagPostUploadJobConfiguration.java
@Bean
public Job tagPostUploadJob() {
return jobs.get("TAG_POST_UPLOAD_PROCESSING")
.start(updateEnrichmentHashStep())
.next(markChangedTagJudgmentsAsNotIndexedStep())
.next(saveEnrichmentTagLawJournalEntriesStep())
.next(judgmentIndexingProcessStep)
.listener(enrichmentHashProcessedFlagMarker)
.incrementer(new RunIdIncrementer()).build();
}
项目:saos
文件:IndexingJobConfiguration.java
@Bean
@Autowired
public Job judgmentIndexingJob(TaskExecutor judgmentIndexingTaskExecutor) {
return jobs.get("INDEX_NOT_INDEXED_JUDGMENTS")
.start(judgmentIndexingProcessStep(judgmentIndexingTaskExecutor))
.incrementer(new RunIdIncrementer())
.build();
}
项目:saos
文件:NacjImportJobConfiguration.java
@Bean
public Job nacJudgmentImportDownloadJob() {
return jobs.get("IMPORT_NAC_JUDGMENTS_download")
.start(nacJudgmentImportDownloadStep())
.incrementer(new RunIdIncrementer())
.build();
}