-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathIndexMetadataService.kt
38 lines (33 loc) · 1.55 KB
/
IndexMetadataService.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
package org.opensearch.indexmanagement.spi.indexstatemanagement
import org.opensearch.client.Client
import org.opensearch.cluster.service.ClusterService
import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ISMIndexMetadata
/**
* ISM by default considers all the index metadata to be part of the cluster state,
* if that doesn't hold true and indices metadata is present in some other place and
* ISM still need to manage these indices the following interface provides a mechanism
* for ISM extensions to register the metadata service for the type so ISM can get the
* index metadata for these special type of indices.
*
* ISM Rest APIs allows support for type param which determines the type of index, if there
* is a registered metadata service for the type - ISM will use the service to get the metadata
* else uses the default i.e cluster state
*/
interface IndexMetadataService {
/**
* Returns the index metadata needed for ISM
*/
suspend fun getMetadata(indices: List<String>, client: Client, clusterService: ClusterService): Map<String, ISMIndexMetadata>
/**
* Returns all the indices metadata
*/
suspend fun getMetadataForAllIndices(client: Client, clusterService: ClusterService): Map<String, ISMIndexMetadata>
/**
* Returns an optional setting path which, when set to true in the index settings, overrides a cluster level metadata write block.
*/
fun getIndexMetadataWriteOverrideSetting(): String? = null
}