File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
server/src/main/java/org/opensearch/indices Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments