Skip to content

Commit 017d721

Browse files
committed
Fix
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
1 parent 25702d7 commit 017d721

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

server/src/main/java/org/opensearch/indices/SystemIndexRegistry.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public static Set<String> matchesSystemIndexPattern(Set<String> indexExpressions
5959
return indexExpressions.stream().filter(pattern -> Regex.simpleMatch(SYSTEM_INDEX_PATTERNS, pattern)).collect(Collectors.toSet());
6060
}
6161

62+
public static boolean matchesSystemIndexPattern(String index) {
63+
return Regex.simpleMatch(SYSTEM_INDEX_PATTERNS, index);
64+
}
65+
6266
public static Set<String> matchesPluginSystemIndexPattern(String pluginClassName, Set<String> indexExpressions) {
6367
if (!SYSTEM_INDEX_DESCRIPTORS_MAP.containsKey(pluginClassName)) {
6468
return Collections.emptySet();
@@ -72,6 +76,19 @@ public static Set<String> matchesPluginSystemIndexPattern(String pluginClassName
7276
.collect(Collectors.toSet());
7377
}
7478

79+
public static boolean matchesPluginSystemIndexPattern(String pluginClassName, String index) {
80+
Collection<SystemIndexDescriptor> systemIndexDescriptors = SYSTEM_INDEX_DESCRIPTORS_MAP.get(pluginClassName);
81+
if (systemIndexDescriptors == null) {
82+
return false;
83+
}
84+
String[] pluginSystemIndexPatterns = systemIndexDescriptors
85+
.stream()
86+
.map(SystemIndexDescriptor::getIndexPattern)
87+
.toArray(String[]::new);
88+
89+
90+
}
91+
7592
static List<SystemIndexDescriptor> getAllDescriptors() {
7693
return SYSTEM_INDEX_DESCRIPTORS_MAP.values().stream().flatMap(Collection::stream).collect(Collectors.toList());
7794
}

0 commit comments

Comments
 (0)