Merge pull request #2926 from hapifhir/issue-2925-remove-duplicate-definition
Remove essentially duplicate bean definition
This commit is contained in:
commit
281596d5f2
|
@ -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.GoldenResourceAnnotatingProcessor;
|
||||||
import ca.uhn.fhir.jpa.batch.processor.PidToIBaseResourceProcessor;
|
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.batch.core.configuration.annotation.StepScope;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@ -41,4 +42,10 @@ public class CommonBatchJobConfig {
|
||||||
return new GoldenResourceAnnotatingProcessor();
|
return new GoldenResourceAnnotatingProcessor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@StepScope
|
||||||
|
public ReindexWriter reindexWriter() {
|
||||||
|
return new ReindexWriter();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,8 @@ public class ReindexEverythingJobConfig {
|
||||||
private StepBuilderFactory myStepBuilderFactory;
|
private StepBuilderFactory myStepBuilderFactory;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JobBuilderFactory myJobBuilderFactory;
|
private JobBuilderFactory myJobBuilderFactory;
|
||||||
|
@Autowired
|
||||||
|
private ReindexWriter myReindexWriter;
|
||||||
|
|
||||||
@Bean(name = REINDEX_EVERYTHING_JOB_NAME)
|
@Bean(name = REINDEX_EVERYTHING_JOB_NAME)
|
||||||
@Lazy
|
@Lazy
|
||||||
|
@ -63,7 +65,7 @@ public class ReindexEverythingJobConfig {
|
||||||
return myStepBuilderFactory.get(REINDEX_EVERYTHING_STEP_NAME)
|
return myStepBuilderFactory.get(REINDEX_EVERYTHING_STEP_NAME)
|
||||||
.<List<Long>, List<Long>>chunk(1)
|
.<List<Long>, List<Long>>chunk(1)
|
||||||
.reader(cronologicalBatchAllResourcePidReader())
|
.reader(cronologicalBatchAllResourcePidReader())
|
||||||
.writer(reindexWriter())
|
.writer(myReindexWriter)
|
||||||
.listener(reindexEverythingPidCountRecorderListener())
|
.listener(reindexEverythingPidCountRecorderListener())
|
||||||
.listener(reindexEverythingPromotionListener())
|
.listener(reindexEverythingPromotionListener())
|
||||||
.build();
|
.build();
|
||||||
|
@ -75,12 +77,6 @@ public class ReindexEverythingJobConfig {
|
||||||
return new CronologicalBatchAllResourcePidReader();
|
return new CronologicalBatchAllResourcePidReader();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
@StepScope
|
|
||||||
public ReindexWriter reindexWriter() {
|
|
||||||
return new ReindexWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@StepScope
|
@StepScope
|
||||||
public PidReaderCounterListener reindexEverythingPidCountRecorderListener() {
|
public PidReaderCounterListener reindexEverythingPidCountRecorderListener() {
|
||||||
|
|
|
@ -51,6 +51,8 @@ public class ReindexJobConfig extends MultiUrlProcessorJobConfig {
|
||||||
private StepBuilderFactory myStepBuilderFactory;
|
private StepBuilderFactory myStepBuilderFactory;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JobBuilderFactory myJobBuilderFactory;
|
private JobBuilderFactory myJobBuilderFactory;
|
||||||
|
@Autowired
|
||||||
|
private ReindexWriter myReindexWriter;
|
||||||
|
|
||||||
@Bean(name = REINDEX_JOB_NAME)
|
@Bean(name = REINDEX_JOB_NAME)
|
||||||
@Lazy
|
@Lazy
|
||||||
|
@ -66,18 +68,12 @@ public class ReindexJobConfig extends MultiUrlProcessorJobConfig {
|
||||||
return myStepBuilderFactory.get(REINDEX_URL_LIST_STEP_NAME)
|
return myStepBuilderFactory.get(REINDEX_URL_LIST_STEP_NAME)
|
||||||
.<List<Long>, List<Long>>chunk(1)
|
.<List<Long>, List<Long>>chunk(1)
|
||||||
.reader(reverseCronologicalBatchResourcePidReader())
|
.reader(reverseCronologicalBatchResourcePidReader())
|
||||||
.writer(reindexWriter())
|
.writer(myReindexWriter)
|
||||||
.listener(pidCountRecorderListener())
|
.listener(pidCountRecorderListener())
|
||||||
.listener(reindexPromotionListener())
|
.listener(reindexPromotionListener())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
@StepScope
|
|
||||||
public ReindexWriter reindexWriter() {
|
|
||||||
return new ReindexWriter();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ExecutionContextPromotionListener reindexPromotionListener() {
|
public ExecutionContextPromotionListener reindexPromotionListener() {
|
||||||
ExecutionContextPromotionListener listener = new ExecutionContextPromotionListener();
|
ExecutionContextPromotionListener listener = new ExecutionContextPromotionListener();
|
||||||
|
|
Loading…
Reference in New Issue