Merge branch '5745-ready-state-batch2' into 5767-add-poll-waiting-step

This commit is contained in:
leif stawnyczy 2024-03-22 14:52:48 -04:00
commit ad44f37e55
5 changed files with 7 additions and 20 deletions

View File

@ -92,8 +92,7 @@ public interface IInstanceStateTransitions extends IWorkChunkCommon, WorkChunkTe
instanceId1, instanceId1,
new JobChunkProgressAccumulator(), new JobChunkProgressAccumulator(),
null, null,
jobDefinitionRegistry, jobDefinitionRegistry
getTransactionManager()
).process(); ).process();
}); });

View File

@ -104,8 +104,7 @@ public abstract class BaseBatch2Config {
JpaStorageSettings theStorageSettings, JpaStorageSettings theStorageSettings,
BatchJobSender theBatchJobSender, BatchJobSender theBatchJobSender,
WorkChunkProcessor theExecutor, WorkChunkProcessor theExecutor,
IReductionStepExecutorService theReductionStepExecutorService, IReductionStepExecutorService theReductionStepExecutorService) {
PlatformTransactionManager theTransactionManager) {
return new JobMaintenanceServiceImpl( return new JobMaintenanceServiceImpl(
theSchedulerService, theSchedulerService,
myPersistence, myPersistence,
@ -113,8 +112,7 @@ public abstract class BaseBatch2Config {
theJobDefinitionRegistry, theJobDefinitionRegistry,
theBatchJobSender, theBatchJobSender,
theExecutor, theExecutor,
theReductionStepExecutorService, theReductionStepExecutorService);
theTransactionManager);
} }
@Bean @Bean

View File

@ -112,16 +112,13 @@ public class JobInstanceProcessor {
private final String myInstanceId; private final String myInstanceId;
private final JobDefinitionRegistry myJobDefinitionegistry; private final JobDefinitionRegistry myJobDefinitionegistry;
private final PlatformTransactionManager myTransactionManager;
public JobInstanceProcessor( public JobInstanceProcessor(
IJobPersistence theJobPersistence, IJobPersistence theJobPersistence,
BatchJobSender theBatchJobSender, BatchJobSender theBatchJobSender,
String theInstanceId, String theInstanceId,
JobChunkProgressAccumulator theProgressAccumulator, JobChunkProgressAccumulator theProgressAccumulator,
IReductionStepExecutorService theReductionStepExecutorService, IReductionStepExecutorService theReductionStepExecutorService,
JobDefinitionRegistry theJobDefinitionRegistry, JobDefinitionRegistry theJobDefinitionRegistry) {
PlatformTransactionManager theTransactionManager) {
myJobPersistence = theJobPersistence; myJobPersistence = theJobPersistence;
myBatchJobSender = theBatchJobSender; myBatchJobSender = theBatchJobSender;
myInstanceId = theInstanceId; myInstanceId = theInstanceId;
@ -131,8 +128,6 @@ public class JobInstanceProcessor {
myJobInstanceProgressCalculator = myJobInstanceProgressCalculator =
new JobInstanceProgressCalculator(theJobPersistence, theProgressAccumulator, theJobDefinitionRegistry); new JobInstanceProgressCalculator(theJobPersistence, theProgressAccumulator, theJobDefinitionRegistry);
myJobInstanceStatusUpdater = new JobInstanceStatusUpdater(theJobDefinitionRegistry); myJobInstanceStatusUpdater = new JobInstanceStatusUpdater(theJobDefinitionRegistry);
myTransactionManager = theTransactionManager;
} }
public void process() { public void process() {

View File

@ -90,7 +90,6 @@ public class JobMaintenanceServiceImpl implements IJobMaintenanceService, IHasSc
private final JobDefinitionRegistry myJobDefinitionRegistry; private final JobDefinitionRegistry myJobDefinitionRegistry;
private final BatchJobSender myBatchJobSender; private final BatchJobSender myBatchJobSender;
private final WorkChunkProcessor myJobExecutorSvc; private final WorkChunkProcessor myJobExecutorSvc;
private final PlatformTransactionManager myTransactionManager;
private final Semaphore myRunMaintenanceSemaphore = new Semaphore(1); private final Semaphore myRunMaintenanceSemaphore = new Semaphore(1);
@ -111,8 +110,7 @@ public class JobMaintenanceServiceImpl implements IJobMaintenanceService, IHasSc
@Nonnull JobDefinitionRegistry theJobDefinitionRegistry, @Nonnull JobDefinitionRegistry theJobDefinitionRegistry,
@Nonnull BatchJobSender theBatchJobSender, @Nonnull BatchJobSender theBatchJobSender,
@Nonnull WorkChunkProcessor theExecutor, @Nonnull WorkChunkProcessor theExecutor,
@Nonnull IReductionStepExecutorService theReductionStepExecutorService, @Nonnull IReductionStepExecutorService theReductionStepExecutorService) {
PlatformTransactionManager theTransactionService) {
myStorageSettings = theStorageSettings; myStorageSettings = theStorageSettings;
myReductionStepExecutorService = theReductionStepExecutorService; myReductionStepExecutorService = theReductionStepExecutorService;
Validate.notNull(theSchedulerService); Validate.notNull(theSchedulerService);
@ -125,7 +123,6 @@ public class JobMaintenanceServiceImpl implements IJobMaintenanceService, IHasSc
myJobDefinitionRegistry = theJobDefinitionRegistry; myJobDefinitionRegistry = theJobDefinitionRegistry;
myBatchJobSender = theBatchJobSender; myBatchJobSender = theBatchJobSender;
myJobExecutorSvc = theExecutor; myJobExecutorSvc = theExecutor;
myTransactionManager = theTransactionService;
} }
@Override @Override
@ -247,8 +244,7 @@ public class JobMaintenanceServiceImpl implements IJobMaintenanceService, IHasSc
instanceId, instanceId,
progressAccumulator, progressAccumulator,
myReductionStepExecutorService, myReductionStepExecutorService,
myJobDefinitionRegistry, myJobDefinitionRegistry);
myTransactionManager);
ourLog.debug( ourLog.debug(
"Triggering maintenance process for instance {} in status {}", "Triggering maintenance process for instance {} in status {}",
instanceId, instanceId,

View File

@ -114,8 +114,7 @@ public class JobMaintenanceServiceImplTest extends BaseBatch2Test {
myJobDefinitionRegistry, myJobDefinitionRegistry,
batchJobSender, batchJobSender,
myJobExecutorSvc, myJobExecutorSvc,
myReductionStepExecutorService, myReductionStepExecutorService
myTransactionService
); );
myStorageSettings.setJobFastTrackingEnabled(true); myStorageSettings.setJobFastTrackingEnabled(true);
} }