Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onboarding system and hidden index #742

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ 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.notifications.action.CreateNotificationConfigAction
import org.opensearch.notifications.action.DeleteNotificationConfigAction
import org.opensearch.notifications.action.GetChannelListAction
Expand All @@ -44,6 +45,7 @@ import org.opensearch.notifications.spi.NotificationCore
import org.opensearch.notifications.spi.NotificationCoreExtension
import org.opensearch.plugins.ActionPlugin
import org.opensearch.plugins.Plugin
import org.opensearch.plugins.SystemIndexPlugin
import org.opensearch.repositories.RepositoriesService
import org.opensearch.rest.RestController
import org.opensearch.rest.RestHandler
Expand All @@ -56,7 +58,7 @@ import java.util.function.Supplier
* Entry point of the OpenSearch Notifications plugin
* This class initializes the rest handlers.
*/
class NotificationPlugin : ActionPlugin, Plugin(), NotificationCoreExtension {
class NotificationPlugin : ActionPlugin, Plugin(), NotificationCoreExtension, SystemIndexPlugin {

lateinit var clusterService: ClusterService // initialized in createComponents()

Expand All @@ -80,6 +82,15 @@ class NotificationPlugin : ActionPlugin, Plugin(), NotificationCoreExtension {
return PluginSettings.getAllSettings()
}

override fun getSystemIndexDescriptors(settings: Settings?): Collection<SystemIndexDescriptor> {
return listOf(
SystemIndexDescriptor(
NotificationConfigIndex.INDEX_NAME,
"System index for storing notification channels related configurations."
)
)
}

/**
* {@inheritDoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal object NotificationConfigIndex : ConfigOperations {
const val SCHEMA_VERSION = "schema_version"

private val log by logger(NotificationConfigIndex::class.java)
private const val INDEX_NAME = ".opensearch-notifications-config"
const val INDEX_NAME = ".opensearch-notifications-config"
private const val MAPPING_FILE_NAME = "notifications-config-mapping.yml"
private const val SETTINGS_FILE_NAME = "notifications-config-settings.yml"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
index:
number_of_shards: "1" # The data size is not expected to be big so keeping it 1 shard
auto_expand_replicas: "0-2"
hidden: true
Loading