From 4e6f307f36b044936f0124dd04abb697fe051b23 Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Mon, 6 Nov 2023 08:49:42 -0800 Subject: [PATCH 1/3] Change imports to align with core lucene upgrade Signed-off-by: Ryan Bogan --- .../org/opensearch/knn/index/mapper/LuceneFieldMapper.java | 4 ++-- src/main/java/org/opensearch/knn/index/util/KNNEngine.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/opensearch/knn/index/mapper/LuceneFieldMapper.java b/src/main/java/org/opensearch/knn/index/mapper/LuceneFieldMapper.java index 94e42ee7c..b28b93028 100644 --- a/src/main/java/org/opensearch/knn/index/mapper/LuceneFieldMapper.java +++ b/src/main/java/org/opensearch/knn/index/mapper/LuceneFieldMapper.java @@ -23,7 +23,7 @@ import java.util.Locale; import java.util.Optional; -import static org.apache.lucene.index.VectorValues.MAX_DIMENSIONS; +import org.apache.lucene.codecs.KnnVectorsFormat; import static org.opensearch.knn.common.KNNConstants.VECTOR_DATA_TYPE_FIELD; import static org.opensearch.knn.index.mapper.KNNVectorFieldMapperUtil.addStoredFieldForVectorField; import static org.opensearch.knn.index.mapper.KNNVectorFieldMapperUtil.buildDocValuesFieldType; @@ -33,7 +33,7 @@ */ public class LuceneFieldMapper extends KNNVectorFieldMapper { - private static final int LUCENE_MAX_DIMENSION = MAX_DIMENSIONS; + private static final int LUCENE_MAX_DIMENSION = KnnVectorsFormat.DEFAULT_MAX_DIMENSIONS; /** FieldType used for initializing VectorField, which is used for creating binary doc values. **/ private final FieldType vectorFieldType; diff --git a/src/main/java/org/opensearch/knn/index/util/KNNEngine.java b/src/main/java/org/opensearch/knn/index/util/KNNEngine.java index 776ea5366..d9336833e 100644 --- a/src/main/java/org/opensearch/knn/index/util/KNNEngine.java +++ b/src/main/java/org/opensearch/knn/index/util/KNNEngine.java @@ -6,7 +6,7 @@ package org.opensearch.knn.index.util; import com.google.common.collect.ImmutableSet; -import org.apache.lucene.index.VectorValues; +import org.apache.lucene.codecs.KnnVectorsFormat; import org.opensearch.common.ValidationException; import org.opensearch.knn.index.KNNMethod; import org.opensearch.knn.index.KNNMethodContext; @@ -40,7 +40,7 @@ public enum KNNEngine implements KNNLibrary { KNNEngine.FAISS, 16_000, KNNEngine.LUCENE, - VectorValues.MAX_DIMENSIONS + KnnVectorsFormat.DEFAULT_MAX_DIMENSIONS ); /** From 0abe65189a67644abf9c9dd3101740ccfad28098 Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Mon, 6 Nov 2023 09:04:11 -0800 Subject: [PATCH 2/3] Increment version to 2.12.0-SNAPSHOT Signed-off-by: Ryan Bogan --- .../workflows/backwards_compatibility_tests_workflow.yml | 8 ++++---- build.gradle | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backwards_compatibility_tests_workflow.yml b/.github/workflows/backwards_compatibility_tests_workflow.yml index b7ce283d1..ad90a79f3 100644 --- a/.github/workflows/backwards_compatibility_tests_workflow.yml +++ b/.github/workflows/backwards_compatibility_tests_workflow.yml @@ -14,8 +14,8 @@ jobs: strategy: matrix: java: [ 11, 17 ] - bwc_version : [ "1.1.0", "1.2.4", "1.3.8", "2.0.1", "2.1.0", "2.2.1", "2.3.0", "2.4.1", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.9.0", "2.10.0" ] - opensearch_version : [ "2.11.0-SNAPSHOT" ] + bwc_version : [ "1.1.0", "1.2.4", "1.3.8", "2.0.1", "2.1.0", "2.2.1", "2.3.0", "2.4.1", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.9.0", "2.10.0", "2.11.0" ] + opensearch_version : [ "2.12.0-SNAPSHOT" ] name: k-NN Restart-Upgrade BWC Tests runs-on: ubuntu-latest @@ -46,8 +46,8 @@ jobs: strategy: matrix: java: [ 11, 17 ] - bwc_version: [ "1.3.8", "2.0.1", "2.1.0", "2.2.1", "2.3.0", "2.4.1", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.9.0", "2.10.0"] - opensearch_version: [ "2.11.0-SNAPSHOT" ] + bwc_version: [ "1.3.8", "2.0.1", "2.1.0", "2.2.1", "2.3.0", "2.4.1", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.9.0", "2.10.0", "2.11.0"] + opensearch_version: [ "2.12.0-SNAPSHOT" ] name: k-NN Rolling-Upgrade BWC Tests runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index 1960dd220..c633f7301 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { ext { // build.version_qualifier parameter applies to knn plugin artifacts only. OpenSearch version must be set // explicitly as 'opensearch.version' property, for instance opensearch.version=2.0.0-rc1-SNAPSHOT - opensearch_version = System.getProperty("opensearch.version", "2.11.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "2.12.0-SNAPSHOT") version_qualifier = System.getProperty("build.version_qualifier", "") opensearch_group = "org.opensearch" } From 62220557870c9d4bd7262da0e53bbead952b11b4 Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Mon, 6 Nov 2023 09:16:02 -0800 Subject: [PATCH 3/3] Fix spotless Signed-off-by: Ryan Bogan --- src/main/java/org/opensearch/knn/index/util/KNNEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/knn/index/util/KNNEngine.java b/src/main/java/org/opensearch/knn/index/util/KNNEngine.java index d9336833e..197bb87f3 100644 --- a/src/main/java/org/opensearch/knn/index/util/KNNEngine.java +++ b/src/main/java/org/opensearch/knn/index/util/KNNEngine.java @@ -40,7 +40,7 @@ public enum KNNEngine implements KNNLibrary { KNNEngine.FAISS, 16_000, KNNEngine.LUCENE, - KnnVectorsFormat.DEFAULT_MAX_DIMENSIONS + KnnVectorsFormat.DEFAULT_MAX_DIMENSIONS ); /**