public JobEntity createSeedJob() { JobEntity seedJob = BATCH_SEED_JOB_DECLARATION.createJobInstance(this); Context.getCommandContext().getJobManager().insertAndHintJobExecutor(seedJob); return seedJob; }
public JobEntity createSeedJob() { JobEntity seedJob = BATCH_SEED_JOB_DECLARATION.createJobInstance(this); Context.getCommandContext().getJobManager().insertAndHintJobExecutor(seedJob); return seedJob; }
jobManager.insertAndHintJobExecutor(job); historyCleanupJobs.add(job);
jobManager.insertAndHintJobExecutor(job); historyCleanupJobs.add(job);
protected List<Job> createJobs(int degreeOfParallelism, int[][] minuteChunks) { CommandContext commandContext = Context.getCommandContext(); PropertyManager propertyManager = commandContext.getPropertyManager(); JobManager jobManager = commandContext.getJobManager(); //exclusive lock propertyManager.acquireExclusiveLockForHistoryCleanupJob(); //check again after lock List<Job> historyCleanupJobs = getHistoryCleanupJobs(); if (historyCleanupJobs.isEmpty()) { for (int[] minuteChunk : minuteChunks) { JobEntity job = createJob(minuteChunk); jobManager.insertAndHintJobExecutor(job); historyCleanupJobs.add(job); } } return historyCleanupJobs; }
protected List<Job> createJobs(int degreeOfParallelism, int[][] minuteChunks) { CommandContext commandContext = Context.getCommandContext(); PropertyManager propertyManager = commandContext.getPropertyManager(); JobManager jobManager = commandContext.getJobManager(); //exclusive lock propertyManager.acquireExclusiveLockForHistoryCleanupJob(); //check again after lock List<Job> historyCleanupJobs = getHistoryCleanupJobs(); if (historyCleanupJobs.isEmpty()) { for (int[] minuteChunk : minuteChunks) { JobEntity job = createJob(minuteChunk); jobManager.insertAndHintJobExecutor(job); historyCleanupJobs.add(job); } } return historyCleanupJobs; }
public JobEntity createMonitorJob(boolean setDueDate) { // Maybe use an other job declaration JobEntity monitorJob = BATCH_MONITOR_JOB_DECLARATION.createJobInstance(this); if (setDueDate) { monitorJob.setDuedate(calculateMonitorJobDueDate()); } Context.getCommandContext() .getJobManager().insertAndHintJobExecutor(monitorJob); return monitorJob; }
public JobEntity createMonitorJob(boolean setDueDate) { // Maybe use an other job declaration JobEntity monitorJob = BATCH_MONITOR_JOB_DECLARATION.createJobInstance(this); if (setDueDate) { monitorJob.setDuedate(calculateMonitorJobDueDate()); } Context.getCommandContext() .getJobManager().insertAndHintJobExecutor(monitorJob); return monitorJob; }
job.setDeploymentId(deploymentId); jobManager.insertAndHintJobExecutor(job); createdJobs++;
job.setDeploymentId(deploymentId); jobManager.insertAndHintJobExecutor(job); createdJobs++;
jobManager.insertAndHintJobExecutor(job);
jobManager.insertAndHintJobExecutor(job);
public JobEntity createSeedJob() { JobEntity seedJob = BATCH_SEED_JOB_DECLARATION.createJobInstance(this); Context.getCommandContext().getJobManager().insertAndHintJobExecutor(seedJob); return seedJob; }
jobManager.insertAndHintJobExecutor(job); historyCleanupJobs.add(job);
protected List<Job> createJobs(int degreeOfParallelism, int[][] minuteChunks) { CommandContext commandContext = Context.getCommandContext(); PropertyManager propertyManager = commandContext.getPropertyManager(); JobManager jobManager = commandContext.getJobManager(); //exclusive lock propertyManager.acquireExclusiveLockForHistoryCleanupJob(); //check again after lock List<Job> historyCleanupJobs = getHistoryCleanupJobs(); if (historyCleanupJobs.isEmpty()) { for (int[] minuteChunk : minuteChunks) { JobEntity job = createJob(minuteChunk); jobManager.insertAndHintJobExecutor(job); historyCleanupJobs.add(job); } } return historyCleanupJobs; }
@Override public boolean createJobs(BatchEntity batch) { final JobManager jobManager = Context.getCommandContext().getJobManager(); final CustomBatchConfiguration<T> configuration = readConfiguration(batch.getConfigurationBytes()); List<T> data = configuration.getData(); // view of process instances to process int batchJobsPerSeed = batch.getBatchJobsPerSeed(); int invocationsPerBatchJob = batch.getInvocationsPerBatchJob(); int numberOfItemsToProcess = Math.min(invocationsPerBatchJob * batchJobsPerSeed, data.size()); // view of process instances to process List<T> dataSubSet = data.subList(0, numberOfItemsToProcess); int createdJobs = 0; while (!dataSubSet.isEmpty()) { int lastIdIndex = Math.min(batch.getInvocationsPerBatchJob(), dataSubSet.size()); List<T> dataForJob = dataSubSet.subList(0, lastIdIndex); final JobEntity job = createBatchJob(batch, dataForJob); jobManager.insertAndHintJobExecutor(job); dataForJob.clear(); createdJobs++; } // update created jobs for batch batch.setJobsCreated(batch.getJobsCreated() + createdJobs); // update batch configuration batch.setConfigurationBytes(writeConfiguration(configuration)); return data.isEmpty(); }
public JobEntity createMonitorJob(boolean setDueDate) { // Maybe use an other job declaration JobEntity monitorJob = BATCH_MONITOR_JOB_DECLARATION.createJobInstance(this); if (setDueDate) { monitorJob.setDuedate(calculateMonitorJobDueDate()); } Context.getCommandContext() .getJobManager().insertAndHintJobExecutor(monitorJob); return monitorJob; }
job.setDeploymentId(deploymentId); jobManager.insertAndHintJobExecutor(job); createdJobs++;
jobManager.insertAndHintJobExecutor(job);