Skip to content

Commit

Permalink
Converts .opendistro-job-scheduler-lock index into a system index (#474
Browse files Browse the repository at this point in the history
…) (#478)

* Converts .opendistro-job-scheduler-lock into a system index

Signed-off-by: Joshua Palis <[email protected]>

* testing

Signed-off-by: Joshua Palis <[email protected]>

* setting fail-fast to false

Signed-off-by: Joshua Palis <[email protected]>

* reverting CI/thread context modifications to the lockservice

Signed-off-by: Joshua Palis <[email protected]>

---------

Signed-off-by: Joshua Palis <[email protected]>
(cherry picked from commit 0cec350)

Co-authored-by: Joshua Palis <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and joshpalis authored Aug 30, 2023
1 parent 13721ca commit 9107d41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

public final class LockService {
private static final Logger logger = LogManager.getLogger(LockService.class);
private static final String LOCK_INDEX_NAME = ".opendistro-job-scheduler-lock";
public static final String LOCK_INDEX_NAME = ".opendistro-job-scheduler-lock";

private final Client client;
private final ClusterService clusterService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
import org.opensearch.env.Environment;
import org.opensearch.env.NodeEnvironment;
import org.opensearch.index.IndexModule;
import org.opensearch.indices.SystemIndexDescriptor;
import org.opensearch.jobscheduler.utils.JobDetailsService;
import org.opensearch.plugins.ActionPlugin;
import org.opensearch.plugins.ExtensiblePlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.SystemIndexPlugin;
import org.opensearch.repositories.RepositoriesService;
import org.opensearch.rest.RestController;
import org.opensearch.script.ScriptService;
Expand All @@ -61,7 +63,7 @@

import com.google.common.collect.ImmutableList;

public class JobSchedulerPlugin extends Plugin implements ActionPlugin, ExtensiblePlugin {
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";
Expand All @@ -81,6 +83,13 @@ public JobSchedulerPlugin() {
this.indexToJobProviders = new HashMap<>();
}

@Override
public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings settings) {
return Collections.singletonList(
new SystemIndexDescriptor(LockService.LOCK_INDEX_NAME, "Stores lock documents used for plugin job execution")
);
}

@Override
public Collection<Object> createComponents(
Client client,
Expand Down

0 comments on commit 9107d41

Please sign in to comment.