-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
K-NN Plugin Upgrade with Lucene 10.0.1 #2429
Conversation
988dcd2
to
a4e06cd
Compare
it looks like
|
Yes ...Agree ...We need to change to alpha !! lots of things started breaking ..This Pr would be updated with all latest changes. |
934094b
to
e0f283e
Compare
1a823aa
to
f46aae1
Compare
src/main/java/org/opensearch/knn/index/KNNVectorDVLeafFieldData.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/KNN80Codec/KNN80DocValuesProducer.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsReader.java
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/query/common/DocAndScoreQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/vectorvalues/KNNVectorValuesIterator.java
Show resolved
Hide resolved
Signed-off-by: Vikasht34 <[email protected]>
@@ -81,12 +80,13 @@ public float[] get(int i) { | |||
* @return A KNNVectorScriptDocValues object based on the type of the values. | |||
* @throws IllegalArgumentException If the type of values is unsupported. | |||
*/ | |||
public static KNNVectorScriptDocValues create(DocIdSetIterator values, String fieldName, VectorDataType vectorDataType) { | |||
public static KNNVectorScriptDocValues create(Object values, String fieldName, VectorDataType vectorDataType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we avoid passing the Object
here? Can we use KNNVectorValues abstraction we have created in our k-NN plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can give a try in next PR. I was thinking to compplety remove all the abstraction we have created. I will discuss with you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case lets cut a GH issue and put it as a TODO as part of 3.0 release that we need to pick that item
private int lastOrd = -1; | ||
@Getter | ||
@Setter | ||
private Object lastAccessedVector = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the old comment, lets try to avoid Object data type. Please have a GH issue on this and should be taken as part of next PR.
protected DocIdSetIterator docIdSetIterator; | ||
private static final List<Function<DocIdSetIterator, Boolean>> VALID_ITERATOR_INSTANCE = List.of( | ||
(itr) -> itr instanceof BinaryDocValues, | ||
(itr) -> itr instanceof FloatVectorValues, | ||
(itr) -> itr instanceof ByteVectorValues | ||
); | ||
|
||
DocIdsIteratorValues(@NonNull final DocIdSetIterator docIdSetIterator) { | ||
validateIteratorType(docIdSetIterator); | ||
private final DocIdSetIterator docIdSetIterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this class will also need a bit of refactoring, for now to unblock main this is fine. Lets have a GH issue for this to fix the abstraction. Because this class otherwise is not going to be maintainable in future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the code. Lets have the follow up GH issues and PR on the refactoring. Since k-NN plugin is dependency for other plugins I am approving this PR so that we can unblock other plugin main branches
Description
As per Lucene 10.0.1 upgrade, There are lots of breaking changes. This PR consumes Lucene 10.0.1 as part of Opensearch 3.0.0 snapshot and Fixes all breaking changes.
Note :- This PR Does not aim to refactor any part of code, It's just making compatible with Lucene 10.0.1
Resolves this issues
#2434
#2433
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.