diff --git a/build.gradle b/build.gradle index be142854..2fe8efdc 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ ext { licenseHeaders.enabled = true testingConventions.enabled = false -forbiddenApis.ignoreFailures = true +forbiddenApis.ignoreFailures = false dependencyLicenses.enabled = false thirdPartyAudit.enabled = false diff --git a/src/main/java/org/opensearch/jobscheduler/JobSchedulerPlugin.java b/src/main/java/org/opensearch/jobscheduler/JobSchedulerPlugin.java index a14da3c7..5d2f2d02 100644 --- a/src/main/java/org/opensearch/jobscheduler/JobSchedulerPlugin.java +++ b/src/main/java/org/opensearch/jobscheduler/JobSchedulerPlugin.java @@ -9,7 +9,6 @@ package org.opensearch.jobscheduler; import org.opensearch.action.ActionRequest; -import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; @@ -46,7 +45,6 @@ import org.opensearch.jobscheduler.transport.schedule.TransportGetScheduleAction; import org.opensearch.jobscheduler.utils.JobDetailsService; import org.opensearch.plugins.ActionPlugin; -import org.opensearch.plugins.ClusterPlugin; import org.opensearch.plugins.ExtensiblePlugin; import org.opensearch.plugins.Plugin; import org.opensearch.plugins.SystemIndexPlugin; @@ -71,7 +69,7 @@ import com.google.common.collect.ImmutableList; -public class JobSchedulerPlugin extends Plugin implements ActionPlugin, ExtensiblePlugin, SystemIndexPlugin, ClusterPlugin { +public class JobSchedulerPlugin extends Plugin implements ActionPlugin, ExtensiblePlugin, SystemIndexPlugin { public static final String OPEN_DISTRO_JOB_SCHEDULER_THREAD_POOL_NAME = "open_distro_job_scheduler"; public static final String JS_BASE_URI = "/_plugins/_job_scheduler"; @@ -268,9 +266,4 @@ public List getRestHandlers( return Arrays.asList(new ActionHandler<>(GetScheduleAction.INSTANCE, TransportGetScheduleAction.class)); } - @Override - public void onNodeStarted(DiscoveryNode localNode) { - sweeper.afterStart(); - } - } diff --git a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java index 8a512f91..de34ff9f 100644 --- a/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java +++ b/src/main/java/org/opensearch/jobscheduler/sweeper/JobSweeper.java @@ -301,11 +301,6 @@ void initBackgroundSweep() { this.fullSweepExecutor.submit(this::sweepAllJobIndices); } }; - Runnable sweepOnStartup = () -> { this.fullSweepExecutor.submit(this::sweepAllJobIndices); }; - // Sweep on startup - if (this.threadPool.generic() != null) { - this.threadPool.generic().submit(sweepOnStartup); - } this.scheduledFullSweep = this.threadPool.scheduleWithFixedDelay(scheduledSweep, sweepPeriod, ThreadPool.Names.SAME); }