Skip to content

Commit 5b9e8a9

Browse files
committed
Use ml plugin system index prefix to skip delete
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
1 parent b1418df commit 5b9e8a9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/testFixtures/java/org/opensearch/knn/ODFERestTestCase.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151

5252
import static org.opensearch.knn.TestUtils.KNN_BWC_PREFIX;
5353
import static org.opensearch.knn.TestUtils.OPENDISTRO_SECURITY;
54+
import static org.opensearch.knn.TestUtils.ML_PLUGIN_SYSTEM_INDEX_PREFIX;
5455
import static org.opensearch.knn.TestUtils.OPENSEARCH_SYSTEM_INDEX_PREFIX;
55-
import static org.opensearch.knn.TestUtils.PLUGINS_ML_CONFIG_INDEX_NAME;
5656
import static org.opensearch.knn.TestUtils.SECURITY_AUDITLOG_PREFIX;
5757
import static org.opensearch.knn.TestUtils.SKIP_DELETE_MODEL_INDEX;
5858
import static org.opensearch.knn.common.KNNConstants.MODELS;
@@ -63,7 +63,12 @@
6363
*/
6464
public abstract class ODFERestTestCase extends OpenSearchRestTestCase {
6565

66-
private final Set<String> IMMUTABLE_INDEX_PREFIXES = Set.of(KNN_BWC_PREFIX, SECURITY_AUDITLOG_PREFIX, OPENSEARCH_SYSTEM_INDEX_PREFIX);
66+
private final Set<String> IMMUTABLE_INDEX_PREFIXES = Set.of(
67+
KNN_BWC_PREFIX,
68+
SECURITY_AUDITLOG_PREFIX,
69+
OPENSEARCH_SYSTEM_INDEX_PREFIX,
70+
ML_PLUGIN_SYSTEM_INDEX_PREFIX
71+
);
6772

6873
protected boolean isHttps() {
6974
return Optional.ofNullable(System.getProperty("https")).map("true"::equalsIgnoreCase).orElse(false);
@@ -213,7 +218,6 @@ private boolean skipDeleteIndex(String indexName) {
213218
return indexName == null
214219
|| OPENDISTRO_SECURITY.equals(indexName)
215220
|| IMMUTABLE_INDEX_PREFIXES.stream().anyMatch(indexName::startsWith)
216-
|| MODEL_INDEX_NAME.equals(indexName)
217-
|| PLUGINS_ML_CONFIG_INDEX_NAME.equals(indexName);
221+
|| MODEL_INDEX_NAME.equals(indexName);
218222
}
219223
}

src/testFixtures/java/org/opensearch/knn/TestUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class TestUtils {
9999
public static final String UPGRADED_CLUSTER = "upgraded_cluster";
100100
public static final String SECURITY_AUDITLOG_PREFIX = "security-auditlog";
101101
public static final String OPENSEARCH_SYSTEM_INDEX_PREFIX = ".opensearch";
102-
public static final String PLUGINS_ML_CONFIG_INDEX_NAME = ".plugins-ml-config";
102+
public static final String ML_PLUGIN_SYSTEM_INDEX_PREFIX = ".plugins-ml";
103103

104104
// Generating vectors using random function with a seed which makes these vectors standard and generate same vectors for each run.
105105
public static float[][] randomlyGenerateStandardVectors(int numVectors, int dimensions, int seed) {

0 commit comments

Comments
 (0)