From c855912e890ea565f1e3f41c7643b6692a0701fe Mon Sep 17 00:00:00 2001 From: Navneet Verma Date: Tue, 22 Aug 2023 22:56:48 -0700 Subject: [PATCH] Fixing the MMapsettings for the vector files generated by Lucene engine Signed-off-by: Navneet Verma --- .../java/org/opensearch/knn/plugin/KNNPlugin.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/opensearch/knn/plugin/KNNPlugin.java b/src/main/java/org/opensearch/knn/plugin/KNNPlugin.java index 53e9f3105..ea962ecff 100644 --- a/src/main/java/org/opensearch/knn/plugin/KNNPlugin.java +++ b/src/main/java/org/opensearch/knn/plugin/KNNPlugin.java @@ -105,7 +105,6 @@ import java.util.Optional; import java.util.function.Supplier; import java.util.stream.Collectors; -import java.util.stream.Stream; import static java.util.Collections.singletonList; import static org.opensearch.knn.common.KNNConstants.KNN_THREAD_POOL_PREFIX; @@ -355,10 +354,11 @@ public Settings additionalSettings() { final List engineSettings = Arrays.stream(KNNEngine.values()) .flatMap(engine -> engine.mmapFileExtensions().stream()) .collect(Collectors.toList()); - final List combinedSettings = Stream.concat( - IndexModule.INDEX_STORE_HYBRID_MMAP_EXTENSIONS.getDefault(Settings.EMPTY).stream(), - engineSettings.stream() - ).collect(Collectors.toList()); - return Settings.builder().putList(IndexModule.INDEX_STORE_HYBRID_MMAP_EXTENSIONS.getKey(), combinedSettings).build(); + + List finalSettings = IndexModule.INDEX_STORE_HYBRID_NIO_EXTENSIONS.getDefault(Settings.EMPTY) + .stream() + .filter(str -> !engineSettings.contains(str)) + .collect(Collectors.toList()); + return Settings.builder().putList(IndexModule.INDEX_STORE_HYBRID_NIO_EXTENSIONS.getKey(), finalSettings).build(); } }