Issue 3804 application fails to start 610 pre14 snapshot with beandefinitionoverrideexception invalid bean definition with name loadidsstep (#3819)

* shared steps

* Add changelog

* Rename as suggested

* Remove unnecessary bean

* Add missing imports

* Remove parent class not used anymore

Co-authored-by: leif stawnyczy <leifstawnyczy@leifs-MacBook-Pro.local>
Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>
This commit is contained in:
jmarchionatto 2022-07-29 09:23:34 -04:00 committed by GitHub
parent 5586b325ce
commit 8346c0263b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 41 deletions

View File

@ -1,35 +0,0 @@
package ca.uhn.fhir.batch2.jobs.config;
/*-
* #%L
* hapi-fhir-storage-batch2-jobs
* %%
* Copyright (C) 2014 - 2022 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import ca.uhn.fhir.batch2.jobs.step.LoadIdsStep;
import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SharedCtx {
@Bean
public LoadIdsStep loadIdsStep(IBatch2DaoSvc theBatch2DaoSvc) {
return new LoadIdsStep(theBatch2DaoSvc);
}
}

View File

@ -22,9 +22,9 @@ package ca.uhn.fhir.batch2.jobs.expunge;
import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson;
import ca.uhn.fhir.batch2.jobs.chunk.ResourceIdListWorkChunkJson;
import ca.uhn.fhir.batch2.jobs.config.SharedCtx;
import ca.uhn.fhir.batch2.jobs.parameters.UrlListValidator;
import ca.uhn.fhir.batch2.jobs.step.GenerateRangeChunksStep;
import ca.uhn.fhir.batch2.jobs.step.LoadIdsStep;
import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc;
@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class DeleteExpungeAppCtx extends SharedCtx {
public class DeleteExpungeAppCtx {
public static final String JOB_DELETE_EXPUNGE = "DELETE_EXPUNGE";
@ -64,7 +64,7 @@ public class DeleteExpungeAppCtx extends SharedCtx {
"load-ids",
"Load IDs of resources to expunge",
ResourceIdListWorkChunkJson.class,
loadIdsStep(theBatch2DaoSvc))
new LoadIdsStep(theBatch2DaoSvc))
.addLastStep("expunge",
"Perform the resource expunge",
expungeStep(theHapiTransactionService, theDeleteExpungeSvc)

View File

@ -23,10 +23,10 @@ package ca.uhn.fhir.batch2.jobs.reindex;
import ca.uhn.fhir.batch2.api.IJobCoordinator;
import ca.uhn.fhir.batch2.jobs.chunk.PartitionedUrlChunkRangeJson;
import ca.uhn.fhir.batch2.jobs.chunk.ResourceIdListWorkChunkJson;
import ca.uhn.fhir.batch2.jobs.config.SharedCtx;
import ca.uhn.fhir.batch2.jobs.parameters.UrlListValidator;
import ca.uhn.fhir.batch2.jobs.parameters.UrlPartitioner;
import ca.uhn.fhir.batch2.jobs.step.GenerateRangeChunksStep;
import ca.uhn.fhir.batch2.jobs.step.LoadIdsStep;
import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jpa.api.svc.IBatch2DaoSvc;
@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ReindexAppCtx extends SharedCtx {
public class ReindexAppCtx {
public static final String JOB_REINDEX = "REINDEX";
@ -59,7 +59,7 @@ public class ReindexAppCtx extends SharedCtx {
"load-ids",
"Load IDs of resources to reindex",
ResourceIdListWorkChunkJson.class,
loadIdsStep(theBatch2DaoSvc))
new LoadIdsStep(theBatch2DaoSvc))
.addLastStep("reindex",
"Perform the resource reindex",
reindexStep()