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(); ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(this.getClass().getName()); jobDetail.setId(this.getClass().getName());
jobDetail.setJobClass(Job.class); jobDetail.setJobClass(Job.class);
mySchedulerService.scheduleFixedDelayClustered(JOB_INTERVAL_MILLIS, jobDetail); mySchedulerService.scheduleClusteredJob(JOB_INTERVAL_MILLIS, jobDetail);
} }
public static class Job implements HapiJob { public static class Job implements HapiJob {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -96,7 +96,7 @@ public class ResourceCountCache {
ScheduledJobDefinition jobDetail = new ScheduledJobDefinition(); ScheduledJobDefinition jobDetail = new ScheduledJobDefinition();
jobDetail.setId(ResourceCountCache.class.getName()); jobDetail.setId(ResourceCountCache.class.getName());
jobDetail.setJobClass(ResourceCountCache.SubmitJob.class); 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 { public static class SubmitJob implements Job {

View File

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

View File

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

View File

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

View File

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

View File

@ -35,14 +35,14 @@ public interface ISchedulerService {
* @param theIntervalMillis How many milliseconds between passes should this job run * @param theIntervalMillis How many milliseconds between passes should this job run
* @param theJobDefinition The Job to fire * @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) * 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 theIntervalMillis How many milliseconds between passes should this job run
* @param theJobDefinition The Job to fire * @param theJobDefinition The Job to fire
*/ */
void scheduleFixedDelayClustered(long theIntervalMillis, ScheduledJobDefinition theJobDefinition); void scheduleClusteredJob(long theIntervalMillis, ScheduledJobDefinition theJobDefinition);
boolean isStopping(); boolean isStopping();
} }