opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.
https://opendistro.github.io/
Apache License 2.0
277 stars 55 forks source link

Abstract out components and clean up JNI layer to more easily support additional libraries #319

Closed jmazanec15 closed 3 years ago

jmazanec15 commented 3 years ago

Issue #, if available:

Description of changes: This PR does a bit of refactoring of the jni library so that code can be re-used when adding support for other libraries. It takes out common code related to exception handling and JNI translations into a separate jni_util module.

Additionally, it cleans up a few other things such as naming, style, exception checking, clang-tidy warnings. For naming of utility functions, I decided to follow Google's conventions here: https://google.github.io/styleguide/cppguide.html#Function_Names. Overall, this change may slightly improve performance, but not significantly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov[bot] commented 3 years ago

Codecov Report

Merging #319 (2e8ae10) into master (5a75432) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #319   +/-   ##
=========================================
  Coverage     80.71%   80.71%           
  Complexity      396      396           
=========================================
  Files            62       62           
  Lines          1504     1504           
  Branches        136      136           
=========================================
  Hits           1214     1214           
  Misses          241      241           
  Partials         49       49           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5a75432...2e8ae10. Read the comment docs.

jmazanec15 commented 3 years ago

Closing PR. Will make changes when we merge faiss-support into main.