use of com.google.cloud.dataproc.v1beta2.Job in project pentaho-platform by pentaho.
the class SchedulerService method updateJob.
public Job updateJob(JobScheduleRequest scheduleRequest) throws IllegalAccessException, IOException, SchedulerException {
Job job = getScheduler().getJob(scheduleRequest.getJobId());
if (job != null) {
scheduleRequest.getJobParameters().add(new JobScheduleParam(QuartzScheduler.RESERVEDMAPKEY_ACTIONUSER, job.getUserName()));
}
Job newJob = createJob(scheduleRequest);
removeJob(scheduleRequest.getJobId());
return newJob;
}
use of com.google.cloud.dataproc.v1beta2.Job in project pentaho-platform by pentaho.
the class SchedulerService method pauseJob.
public JobState pauseJob(String jobId) throws SchedulerException {
Job job = getJob(jobId);
if (isScheduleAllowed() || PentahoSessionHolder.getSession().getName().equals(job.getUserName())) {
getScheduler().pauseJob(jobId);
}
job = getJob(jobId);
return job.getState();
}
use of com.google.cloud.dataproc.v1beta2.Job in project pentaho-platform by pentaho.
the class SchedulerService method resumeJob.
public JobState resumeJob(String jobId) throws SchedulerException {
Job job = getJob(jobId);
if (isScheduleAllowed() || PentahoSessionHolder.getSession().getName().equals(job.getUserName())) {
getScheduler().resumeJob(jobId);
}
job = getJob(jobId);
return job.getState();
}
use of com.google.cloud.dataproc.v1beta2.Job in project pentaho-platform by pentaho.
the class RepositoryCleanerSystemListenerTest method removesJobs_WhenDisabled.
@Test
public void removesJobs_WhenDisabled() throws Exception {
final String jobId = "jobId";
Job job = new Job();
job.setJobId(jobId);
when(scheduler.getJobs(any(IJobFilter.class))).thenReturn(Collections.singletonList(job));
prepareMp();
listener.setGcEnabled(false);
assertTrue(listener.startup(null));
verifyJobRemoved(jobId);
}
use of com.google.cloud.dataproc.v1beta2.Job in project pentaho-platform by pentaho.
the class RepositoryCleanerSystemListenerTest method reschedulesJob_IfFoundDifferent.
@Test
public void reschedulesJob_IfFoundDifferent() throws Exception {
final String oldJobId = "oldJobId";
Job oldJob = new Job();
oldJob.setJobTrigger(new CronJobTrigger());
oldJob.setJobId(oldJobId);
when(scheduler.getJobs(any(IJobFilter.class))).thenReturn(Collections.singletonList(oldJob));
prepareMp();
listener.setExecute(Frequency.NOW.getValue());
assertTrue(listener.startup(null));
verifyJobRemoved(oldJobId);
verifyJobCreated(Frequency.NOW);
}
Aggregations