opensearch-project / k-NN

🆕 Find the k-nearest neighbors (k-NN) for your vector data
https://opensearch.org/docs/latest/search-plugins/knn/index/
Apache License 2.0
152 stars 113 forks source link

Adds Unit tests for NativeEngines990KnnVectorsWriter #2097

Closed shatejas closed 2 weeks ago

shatejas commented 2 weeks ago

Had to separate out the common code in NativeEngines990KnnVectorsWriter to make it easy to write tests. Mocking was difficult to do with the functional interfaces and it was throwing NPE in the test especially with the mock of NativeIndexWriter::flush and NativeIndexWriter::merge where it wasn't able to recognize the mocked writer.

Check List

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.

navneet1v commented 2 weeks ago

Please rebase the code to fix the CIs.