Skip to content

Commit

Permalink
Removed changes to IndexUtils as they're only needed by doc monitors.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Feb 6, 2024
1 parent 885545f commit 54925c5
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.opensearch.commons.alerting.util.IndexUtils
import org.opensearch.core.action.ActionListener
import org.opensearch.core.xcontent.NamedXContentRegistry
import org.opensearch.core.xcontent.XContentParser
import org.opensearch.index.IndexNotFoundException

class IndexUtils {

Expand Down Expand Up @@ -140,27 +139,18 @@ class IndexUtils {

@JvmStatic
fun resolveAllIndices(indices: List<String>, clusterService: ClusterService, resolver: IndexNameExpressionResolver): List<String> {
return resolveAllIndices(indices, clusterService.state(), resolver)
}

@JvmStatic
fun resolveAllIndices(indices: List<String>, clusterState: ClusterState, resolver: IndexNameExpressionResolver): List<String> {
val result = mutableListOf<String>()

indices.forEach { index ->
val concreteIndices = resolver.concreteIndexNames(
clusterState,
clusterService.state(),
IndicesOptions.lenientExpand(),
true,
index
)
result.addAll(concreteIndices)
}

if (result.size == 0) {
throw IndexNotFoundException(indices[0])
}

return result
}

Expand Down

0 comments on commit 54925c5

Please sign in to comment.