本文整理汇总了Java中org.springframework.batch.core.launch.support.RunIdIncrementer类的典型用法代码示例。如果您正苦于以下问题:Java RunIdIncrementer类的具体用法?Java RunIdIncrementer怎么用?Java RunIdIncrementer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RunIdIncrementer类属于org.springframework.batch.core.launch.support包,在下文中一共展示了RunIdIncrementer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getObject
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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();
}
开发者ID:spring-cloud-task-app-starters,项目名称:composed-task-runner,代码行数:22,代码来源:ComposedRunnerJobFactory.java
示例2: retryFailedExecutionOnNonRestartableJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:JobLauncherCommandLineRunnerTests.java
示例3: retryFailedExecutionWithNonIdentifyingParameters
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:JobLauncherCommandLineRunnerTests.java
示例4: job
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
/**
* @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();
}
示例5: retryFailedExecutionOnNonRestartableJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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());
}
示例6: retryFailedExecutionWithNonIdentifyingParameters
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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());
}
示例7: demoJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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();
}
示例8: githubJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@Bean(name = "githubJob")
public Job githubJob() throws Exception {
return jobBuilderFactory.get("githubJob")
.incrementer(new RunIdIncrementer())
.listener(githubJobListener)
.flow(githubStep1())
.end()
.build();
}
示例9: oneJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
/**
* 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();
}
示例10: job
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
/**
* @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();
}
示例11: pushBlackDuckScanToFortifyJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
/**
* 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();
}
开发者ID:blackducksoftware,项目名称:hub-fortify-ssc-integration-service,代码行数:15,代码来源:BlackDuckFortifyJobConfig.java
示例12: lhClubImportJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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();
}
示例13: innofactorImportJob
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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();
}
示例14: incrementExistingExecution
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:JobLauncherCommandLineRunnerTests.java
示例15: retryFailedExecution
import org.springframework.batch.core.launch.support.RunIdIncrementer; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:JobLauncherCommandLineRunnerTests.java