-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LuceneFlatVectorReader uses IOContext.Random to open the read. IOContext.Random indicates the kernel to not read ahead the pages on to physical memory. This causes an increase in merge time due to increase of read ops at runtime. The preload settings signals the kernal to preload the files when the reader is opened Signed-off-by: Tejas Shah <[email protected]>
- Loading branch information
Showing
7 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/test/java/org/opensearch/knn/index/engine/nmslib/NMSLibTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.knn.index.engine.nmslib; | ||
|
||
import org.opensearch.knn.KNNTestCase; | ||
|
||
import java.util.List; | ||
|
||
public class NMSLibTests extends KNNTestCase { | ||
|
||
public void testMmapFileExtensions() { | ||
final List<String> mmapExtensions = Nmslib.INSTANCE.mmapFileExtensions(); | ||
assertNotNull(mmapExtensions); | ||
final List<String> expectedSettings = List.of("vex", "vec"); | ||
assertTrue(expectedSettings.containsAll(mmapExtensions)); | ||
assertTrue(mmapExtensions.containsAll(expectedSettings)); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/java/org/opensearch/knn/plugin/KNNPluginTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.knn.plugin; | ||
|
||
import org.opensearch.common.settings.Settings; | ||
import org.opensearch.test.OpenSearchTestCase; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
public class KNNPluginTests extends OpenSearchTestCase { | ||
|
||
public void testKNNPlugin_additionalSettings() throws IOException { | ||
try (KNNPlugin knnPlugin = new KNNPlugin()) { | ||
Settings additionalSettings = knnPlugin.additionalSettings(); | ||
|
||
Settings settings = Settings.builder().putList("index.store.preload", List.of("vec", "vex")).build(); | ||
assertEquals(settings, additionalSettings); | ||
} | ||
} | ||
} |