rename schedule interface methods

This commit is contained in:
Ken Stevens 2019-11-29 11:04:35 -05:00
parent 321790f6bf
commit 37eef4e3e4
16 changed files with 21 additions and 21 deletions

View File

@ -317,7 +317,7 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(this.getClass().getName());
jobDetail.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayClustered(JOB_INTERVAL_MILLIS, jobDetail);
mySchedulerService.scheduleClusteredJob(JOB_INTERVAL_MILLIS, jobDetail);
}
public static class Job implements HapiJob {

View File

@ -172,12 +172,12 @@ public abstract class BaseSchedulerServiceImpl implements ISchedulerService, Sma
}
@Override
public void scheduleFixedDelayLocal(long theIntervalMillis, ScheduledJobDefinition theJobDefinition) {
public void scheduleLocalJob(long theIntervalMillis, ScheduledJobDefinition theJobDefinition) {
myLocalScheduler.scheduleFixedDelay(theIntervalMillis, theJobDefinition);
}
@Override
public void scheduleFixedDelayClustered(long theIntervalMillis, ScheduledJobDefinition theJobDefinition) {
public void scheduleClusteredJob(long theIntervalMillis, ScheduledJobDefinition theJobDefinition) {
myClusteredScheduler.scheduleFixedDelay(theIntervalMillis, theJobDefinition);
}

View File

@ -62,7 +62,7 @@ public class StaleSearchDeletingSvcImpl implements IStaleSearchDeletingSvc {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(StaleSearchDeletingSvcImpl.class.getName());
jobDetail.setJobClass(StaleSearchDeletingSvcImpl.SubmitJob.class);
mySchedulerService.scheduleFixedDelayClustered(DEFAULT_CUTOFF_SLACK, jobDetail);
mySchedulerService.scheduleClusteredJob(DEFAULT_CUTOFF_SLACK, jobDetail);
}
@Transactional(propagation = Propagation.NEVER)

View File

@ -55,7 +55,7 @@ public abstract class BaseSearchCacheSvcImpl implements ISearchCacheSvc {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(BaseSearchCacheSvcImpl.class.getName());
jobDetail.setJobClass(BaseSearchCacheSvcImpl.SubmitJob.class);
mySchedulerService.scheduleFixedDelayLocal(10 * DateUtils.MILLIS_PER_SECOND, jobDetail);
mySchedulerService.scheduleLocalJob(10 * DateUtils.MILLIS_PER_SECOND, jobDetail);
}
@Override

View File

@ -192,7 +192,7 @@ public class ResourceReindexingSvcImpl implements IResourceReindexingSvc {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(ResourceReindexingSvcImpl.class.getName());
jobDetail.setJobClass(ResourceReindexingSvcImpl.SubmitJob.class);
mySchedulerService.scheduleFixedDelayClustered(10 * DateUtils.MILLIS_PER_SECOND, jobDetail);
mySchedulerService.scheduleClusteredJob(10 * DateUtils.MILLIS_PER_SECOND, jobDetail);
}
@VisibleForTesting

View File

@ -110,7 +110,7 @@ public class CacheWarmingSvcImpl implements ICacheWarmingSvc {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(this.getClass().getName());
jobDetail.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayClustered(JOB_INTERVAL_MILLIS, jobDetail);
mySchedulerService.scheduleClusteredJob(JOB_INTERVAL_MILLIS, jobDetail);
}
public static class Job implements HapiJob {

View File

@ -387,7 +387,7 @@ public class SubscriptionTriggeringSvcImpl implements ISubscriptionTriggeringSvc
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(this.getClass().getName());
jobDetail.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayLocal(JOB_INTERVAL_MILLIS, jobDetail);
mySchedulerService.scheduleLocalJob(JOB_INTERVAL_MILLIS, jobDetail);
}
public static class Job implements HapiJob {

View File

@ -1309,7 +1309,7 @@ public abstract class BaseTermReadSvcImpl implements ITermReadSvc, ApplicationCo
ScheduledJobDefinition vsJobDefinition = new ScheduledJobDefinition();
vsJobDefinition.setId(BaseTermReadSvcImpl.class.getName() + "_preExpandValueSets");
vsJobDefinition.setJobClass(PreExpandValueSetsJob.class);
mySchedulerService.scheduleFixedDelayClustered(10 * DateUtils.MILLIS_PER_MINUTE, vsJobDefinition);
mySchedulerService.scheduleClusteredJob(10 * DateUtils.MILLIS_PER_MINUTE, vsJobDefinition);
}
@Override

View File

@ -267,7 +267,7 @@ public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc {
ScheduledJobDefinition jobDefinition = new ScheduledJobDefinition();
jobDefinition.setId(this.getClass().getName());
jobDefinition.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayLocal(JOB_INTERVAL_MILLIS, jobDefinition);
mySchedulerService.scheduleLocalJob(JOB_INTERVAL_MILLIS, jobDefinition);
}
public static class Job implements HapiJob {

View File

@ -157,7 +157,7 @@ public class TermReindexingSvcImpl implements ITermReindexingSvc {
ScheduledJobDefinition jobDefinition = new ScheduledJobDefinition();
jobDefinition.setId(this.getClass().getName());
jobDefinition.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayLocal(JOB_INTERVAL_MILLIS, jobDefinition);
mySchedulerService.scheduleLocalJob(JOB_INTERVAL_MILLIS, jobDefinition);
}
public static class Job implements HapiJob {

View File

@ -96,7 +96,7 @@ public class ResourceCountCache {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(ResourceCountCache.class.getName());
jobDetail.setJobClass(ResourceCountCache.SubmitJob.class);
mySchedulerService.scheduleFixedDelayLocal(10 * DateUtils.MILLIS_PER_MINUTE, jobDetail);
mySchedulerService.scheduleLocalJob(10 * DateUtils.MILLIS_PER_MINUTE, jobDetail);
}
public static class SubmitJob implements Job {

View File

@ -51,7 +51,7 @@ public class SchedulerServiceImplTest {
.setId(CountingJob.class.getName())
.setJobClass(CountingJob.class);
mySvc.scheduleFixedDelayLocal(100, def);
mySvc.scheduleLocalJob(100, def);
sleepAtLeast(1000);
@ -73,7 +73,7 @@ public class SchedulerServiceImplTest {
svc.create();
svc.start();
mySvc.scheduleFixedDelayLocal(100, def);
mySvc.scheduleLocalJob(100, def);
sleepAtLeast(1000);
@ -91,7 +91,7 @@ public class SchedulerServiceImplTest {
.setJobClass(CountingJob.class);
ourTaskDelay = 500;
mySvc.scheduleFixedDelayLocal(100, def);
mySvc.scheduleLocalJob(100, def);
sleepAtLeast(1000);
@ -109,7 +109,7 @@ public class SchedulerServiceImplTest {
.setJobClass(CountingIntervalJob.class);
ourTaskDelay = 500;
mySvc.scheduleFixedDelayLocal(100, def);
mySvc.scheduleLocalJob(100, def);
sleepAtLeast(2000);

View File

@ -728,7 +728,7 @@ public class SearchParamRegistryImpl implements ISearchParamRegistry {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(SearchParamRegistryImpl.class.getName());
jobDetail.setJobClass(SubmitJob.class);
mySchedulerService.scheduleFixedDelayLocal(10 * DateUtils.MILLIS_PER_SECOND, jobDetail);
mySchedulerService.scheduleLocalJob(10 * DateUtils.MILLIS_PER_SECOND, jobDetail);
}
@Override

View File

@ -92,7 +92,7 @@ public class SubscriptionLoader {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(this.getClass().getName());
jobDetail.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayLocal(JOB_INTERVAL_MILLIS, jobDetail);
mySchedulerService.scheduleLocalJob(JOB_INTERVAL_MILLIS, jobDetail);
}
public static class Job implements HapiJob {

View File

@ -70,7 +70,7 @@ public class AnalyticsInterceptor extends InterceptorAdapter {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(getClass().getName());
jobDetail.setJobClass(SubmitJob.class);
mySchedulerService.scheduleFixedDelayLocal(5000, jobDetail);
mySchedulerService.scheduleLocalJob(5000, jobDetail);
}
@PreDestroy

View File

@ -35,14 +35,14 @@ public interface ISchedulerService {
* @param theIntervalMillis How many milliseconds between passes should this job run
* @param theJobDefinition The Job to fire
*/
void scheduleFixedDelayLocal(long theIntervalMillis, ScheduledJobDefinition theJobDefinition);
void scheduleLocalJob(long theIntervalMillis, ScheduledJobDefinition theJobDefinition);
/**
* This task will execute locally (and should execute on all nodes of the cluster if there is a cluster)
* @param theIntervalMillis How many milliseconds between passes should this job run
* @param theJobDefinition The Job to fire
*/
void scheduleFixedDelayClustered(long theIntervalMillis, ScheduledJobDefinition theJobDefinition);
void scheduleClusteredJob(long theIntervalMillis, ScheduledJobDefinition theJobDefinition);
boolean isStopping();
}