Running batch job

This commit is contained in:
Tadgh 2020-06-02 16:08:19 -07:00
parent 31b7e862d4
commit e8970bce46
5 changed files with 12 additions and 16 deletions

View File

@ -50,10 +50,6 @@ public class TestDstu3Config extends BaseJavaConfigDstu3 {
return new CircularQueueCaptureQueriesListener();
}
@Bean
public IBatchJobSubmitter batchJobSubmitter() {
return new BatchJobSubmitterImpl();
}
@Bean
public BasicDataSource basicDataSource() {

View File

@ -1,5 +1,7 @@
package ca.uhn.fhir.jpa.config;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
import ca.uhn.fhir.jpa.batch.svc.BatchJobSubmitterImpl;
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
import ca.uhn.fhir.jpa.binstore.MemoryBinaryStorageSvcImpl;
import ca.uhn.fhir.jpa.bulk.batch.BulkItemReader;
@ -67,6 +69,11 @@ public class TestR4Config extends BaseJavaConfigR4 {
private Exception myLastStackTrace;
@Bean
public IBatchJobSubmitter batchJobSubmitter() {
return new BatchJobSubmitterImpl();
}
@Bean
public CircularQueueCaptureQueriesListener captureQueriesListener() {
return new CircularQueueCaptureQueriesListener();
@ -82,7 +89,7 @@ public class TestR4Config extends BaseJavaConfigR4 {
@Bean
public Step readPidsStep() {
return myStepBuilderFactory.get("readPidsToBeExportedStep")
.<ResourcePersistentId, ResourcePersistentId > chunk(100)
.<ResourcePersistentId, ResourcePersistentId > chunk(2)
.reader(myBulkItemReader(null))
.writer(mySimplePrinter())
.build();
@ -103,6 +110,7 @@ public class TestR4Config extends BaseJavaConfigR4 {
public BulkItemReader myBulkItemReader(@Value("#{jobParameters['jobUUID']}") String theJobUUID) {
BulkItemReader bulkItemReader = new BulkItemReader();
bulkItemReader.setJobUUID(theJobUUID);
bulkItemReader.setName("bulkItemReader");
return bulkItemReader;
}

View File

@ -123,8 +123,6 @@ public abstract class BaseJpaTest extends BaseTest {
protected IPartitionLookupSvc myPartitionConfigSvc;
@Autowired
private IdHelperService myIdHelperService;
@Autowired
protected IBatchJobSubmitter myBatchJobSubmitter;
@After
public void afterPerformCleanup() {

View File

@ -35,9 +35,6 @@ public class ExpungeHookTest extends BaseJpaDstu3Test {
@Autowired
private DaoConfig myDaoConfig;
@Autowired
private Job testJob;
PointcutLatch myEverythingLatch = new PointcutLatch(Pointcut.STORAGE_PRESTORAGE_EXPUNGE_EVERYTHING);
PointcutLatch myExpungeResourceLatch = new PointcutLatch(Pointcut.STORAGE_PRESTORAGE_EXPUNGE_RESOURCE);
@ -94,9 +91,4 @@ public class ExpungeHookTest extends BaseJpaDstu3Test {
IIdType hookId = hookParams.get(IIdType.class);
assertEquals(expungeId.getValue(), hookId.getValue());
}
@Test
public void testSubmitJob() {
myBatchJobSubmitter.runJob(testJob, new JobParameters());
}
}

View File

@ -14,6 +14,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoSubscription;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoValueSet;
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.api.svc.ISearchCoordinatorSvc;
import ca.uhn.fhir.jpa.batch.api.IBatchJobSubmitter;
import ca.uhn.fhir.jpa.binstore.BinaryAccessProvider;
import ca.uhn.fhir.jpa.binstore.BinaryStorageInterceptor;
import ca.uhn.fhir.jpa.bulk.IBulkDataExportSvc;
@ -181,7 +182,6 @@ public abstract class BaseJpaR4Test extends BaseJpaTest implements ITestDataBui
private static IValidationSupport ourJpaValidationSupportChainR4;
private static IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> ourValueSetDao;
@Autowired
protected IPartitionLookupSvc myPartitionConfigSvc;
@Autowired
@ -460,6 +460,8 @@ public abstract class BaseJpaR4Test extends BaseJpaTest implements ITestDataBui
private IBulkDataExportSvc myBulkDataExportSvc;
@Autowired
private IdHelperService myIdHelperService;
@Autowired
protected IBatchJobSubmitter myBatchJobSubmitter;
@After()
public void afterCleanupDao() {