From 9bebedb47b0fa1256bcf9a446e4fd2b39998d0b8 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 21 Jun 2024 15:33:46 -0400 Subject: [PATCH 1/4] Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors Signed-off-by: Craig Perkins --- .../reportsscheduler/ReportsSchedulerPlugin.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt b/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt index 9fb995fc..7a3858c0 100644 --- a/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt +++ b/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt @@ -20,11 +20,13 @@ import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.env.Environment import org.opensearch.env.NodeEnvironment +import org.opensearch.indices.SystemIndexDescriptor import org.opensearch.jobscheduler.spi.JobSchedulerExtension import org.opensearch.jobscheduler.spi.ScheduledJobParser import org.opensearch.jobscheduler.spi.ScheduledJobRunner import org.opensearch.plugins.ActionPlugin import org.opensearch.plugins.Plugin +import org.opensearch.plugins.SystemIndexPlugin import org.opensearch.reportsscheduler.action.CreateReportDefinitionAction import org.opensearch.reportsscheduler.action.DeleteReportDefinitionAction import org.opensearch.reportsscheduler.action.GetAllReportDefinitionsAction @@ -59,7 +61,7 @@ import java.util.function.Supplier * Entry point of the OpenSearch Reports scheduler plugin. * This class initializes the rest handlers. */ -class ReportsSchedulerPlugin : Plugin(), ActionPlugin, JobSchedulerExtension { +class ReportsSchedulerPlugin : Plugin(), ActionPlugin, SystemIndexPlugin, JobSchedulerExtension { companion object { const val PLUGIN_NAME = "opensearch-reports-scheduler" @@ -77,6 +79,12 @@ class ReportsSchedulerPlugin : Plugin(), ActionPlugin, JobSchedulerExtension { return settingList } + override fun getSystemIndexDescriptors(settings: Settings): Collection { + return listOf( + SystemIndexDescriptor(".opendistro-reports-*", "Reports Scheduler Plugin system index pattern"), + ) + } + /** * {@inheritDoc} */ From 5d8812988d2fc42104c8709e9fbf054682cd267c Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 21 Jun 2024 15:39:14 -0400 Subject: [PATCH 2/4] Remove trailing comma Signed-off-by: Craig Perkins --- .../org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt b/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt index 7a3858c0..90b5859e 100644 --- a/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt +++ b/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt @@ -81,7 +81,7 @@ class ReportsSchedulerPlugin : Plugin(), ActionPlugin, SystemIndexPlugin, JobSch override fun getSystemIndexDescriptors(settings: Settings): Collection { return listOf( - SystemIndexDescriptor(".opendistro-reports-*", "Reports Scheduler Plugin system index pattern"), + SystemIndexDescriptor(".opendistro-reports-*", "Reports Scheduler Plugin system index pattern") ) } From dc266187eda15ea69190dce44e909d9812e39626 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Wed, 26 Jun 2024 12:03:57 -0400 Subject: [PATCH 3/4] Separate system indices Signed-off-by: Craig Perkins --- .../org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt | 4 +++- .../opensearch/reportsscheduler/index/ReportInstancesIndex.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt b/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt index 90b5859e..016a47d6 100644 --- a/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt +++ b/src/main/kotlin/org/opensearch/reportsscheduler/ReportsSchedulerPlugin.kt @@ -40,6 +40,7 @@ import org.opensearch.reportsscheduler.action.UpdateReportInstanceStatusAction import org.opensearch.reportsscheduler.index.ReportDefinitionsIndex import org.opensearch.reportsscheduler.index.ReportDefinitionsIndex.REPORT_DEFINITIONS_INDEX_NAME import org.opensearch.reportsscheduler.index.ReportInstancesIndex +import org.opensearch.reportsscheduler.index.ReportInstancesIndex.REPORT_INSTANCES_INDEX_NAME import org.opensearch.reportsscheduler.resthandler.OnDemandReportRestHandler import org.opensearch.reportsscheduler.resthandler.ReportDefinitionListRestHandler import org.opensearch.reportsscheduler.resthandler.ReportDefinitionRestHandler @@ -81,7 +82,8 @@ class ReportsSchedulerPlugin : Plugin(), ActionPlugin, SystemIndexPlugin, JobSch override fun getSystemIndexDescriptors(settings: Settings): Collection { return listOf( - SystemIndexDescriptor(".opendistro-reports-*", "Reports Scheduler Plugin system index pattern") + SystemIndexDescriptor(REPORT_DEFINITIONS_INDEX_NAME, "Reports Scheduler Plugin Definitions index"), + SystemIndexDescriptor(REPORT_INSTANCES_INDEX_NAME, "Reports Scheduler Plugin Instances index") ) } diff --git a/src/main/kotlin/org/opensearch/reportsscheduler/index/ReportInstancesIndex.kt b/src/main/kotlin/org/opensearch/reportsscheduler/index/ReportInstancesIndex.kt index a7e5303b..766b5f3e 100644 --- a/src/main/kotlin/org/opensearch/reportsscheduler/index/ReportInstancesIndex.kt +++ b/src/main/kotlin/org/opensearch/reportsscheduler/index/ReportInstancesIndex.kt @@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit */ internal object ReportInstancesIndex { private val log by logger(ReportInstancesIndex::class.java) - private const val REPORT_INSTANCES_INDEX_NAME = ".opendistro-reports-instances" + const val REPORT_INSTANCES_INDEX_NAME = ".opendistro-reports-instances" private const val REPORT_INSTANCES_MAPPING_FILE_NAME = "report-instances-mapping.yml" private const val REPORT_INSTANCES_SETTINGS_FILE_NAME = "report-instances-settings.yml" From 909d9bfe26c0ae55f708bd6a4ce98644bfde6e19 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Wed, 26 Jun 2024 14:09:05 -0400 Subject: [PATCH 4/4] Update baseVersion to 2.16.0 Signed-off-by: Craig Perkins --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 11c7de17..dfedc2f9 100644 --- a/build.gradle +++ b/build.gradle @@ -329,7 +329,7 @@ testClusters.integTest { } // For job-scheduler and reports-scheduler, the latest opensearch releases appear to be 1.1.0.0. -String baseVersion = "2.15.0" +String baseVersion = "2.16.0" String bwcVersion = baseVersion + ".0" String baseName = "reportsSchedulerBwcCluster" String bwcFilePath = "src/test/resources/bwc"