Merge remote-tracking branch 'origin/master' into 2849_add_new_mdm_param
This commit is contained in:
commit
528c429a4e
|
@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.batch;
|
|||
|
||||
import ca.uhn.fhir.jpa.batch.processor.GoldenResourceAnnotatingProcessor;
|
||||
import ca.uhn.fhir.jpa.batch.processor.PidToIBaseResourceProcessor;
|
||||
import ca.uhn.fhir.jpa.reindex.job.ReindexWriter;
|
||||
import org.springframework.batch.core.configuration.annotation.StepScope;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -41,4 +42,10 @@ public class CommonBatchJobConfig {
|
|||
return new GoldenResourceAnnotatingProcessor();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@StepScope
|
||||
public ReindexWriter reindexWriter() {
|
||||
return new ReindexWriter();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public class ReindexEverythingJobConfig {
|
|||
private StepBuilderFactory myStepBuilderFactory;
|
||||
@Autowired
|
||||
private JobBuilderFactory myJobBuilderFactory;
|
||||
@Autowired
|
||||
private ReindexWriter myReindexWriter;
|
||||
|
||||
@Bean(name = REINDEX_EVERYTHING_JOB_NAME)
|
||||
@Lazy
|
||||
|
@ -63,7 +65,7 @@ public class ReindexEverythingJobConfig {
|
|||
return myStepBuilderFactory.get(REINDEX_EVERYTHING_STEP_NAME)
|
||||
.<List<Long>, List<Long>>chunk(1)
|
||||
.reader(cronologicalBatchAllResourcePidReader())
|
||||
.writer(reindexWriter())
|
||||
.writer(myReindexWriter)
|
||||
.listener(reindexEverythingPidCountRecorderListener())
|
||||
.listener(reindexEverythingPromotionListener())
|
||||
.build();
|
||||
|
@ -75,12 +77,6 @@ public class ReindexEverythingJobConfig {
|
|||
return new CronologicalBatchAllResourcePidReader();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@StepScope
|
||||
public ReindexWriter reindexWriter() {
|
||||
return new ReindexWriter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@StepScope
|
||||
public PidReaderCounterListener reindexEverythingPidCountRecorderListener() {
|
||||
|
|
|
@ -51,6 +51,8 @@ public class ReindexJobConfig extends MultiUrlProcessorJobConfig {
|
|||
private StepBuilderFactory myStepBuilderFactory;
|
||||
@Autowired
|
||||
private JobBuilderFactory myJobBuilderFactory;
|
||||
@Autowired
|
||||
private ReindexWriter myReindexWriter;
|
||||
|
||||
@Bean(name = REINDEX_JOB_NAME)
|
||||
@Lazy
|
||||
|
@ -66,18 +68,12 @@ public class ReindexJobConfig extends MultiUrlProcessorJobConfig {
|
|||
return myStepBuilderFactory.get(REINDEX_URL_LIST_STEP_NAME)
|
||||
.<List<Long>, List<Long>>chunk(1)
|
||||
.reader(reverseCronologicalBatchResourcePidReader())
|
||||
.writer(reindexWriter())
|
||||
.writer(myReindexWriter)
|
||||
.listener(pidCountRecorderListener())
|
||||
.listener(reindexPromotionListener())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@StepScope
|
||||
public ReindexWriter reindexWriter() {
|
||||
return new ReindexWriter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ExecutionContextPromotionListener reindexPromotionListener() {
|
||||
ExecutionContextPromotionListener listener = new ExecutionContextPromotionListener();
|
||||
|
|
Loading…
Reference in New Issue