From ec120bf13629f0d0c96786591c1368f1be816baa Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 20:20:16 -0500 Subject: [PATCH 1/8] RNM: folder --- .../knn/index/{v1736 => v206}/KNNIndex.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename src/main/java/com/amazon/opendistroforelasticsearch/knn/index/{v1736 => v206}/KNNIndex.java (95%) diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v1736/KNNIndex.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java similarity index 95% rename from src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v1736/KNNIndex.java rename to src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java index 219b4af5..6c43f05b 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v1736/KNNIndex.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java @@ -29,16 +29,16 @@ /** * JNI layer to communicate with the nmslib - * This class refers to the nms library build with version tag 1.7.3.6 - * See tag1.7.3.6 + * This class refers to the nms library build with version tag 2.0.6 + * See tag2.0.6 */ public class KNNIndex implements AutoCloseable { - public static NmsLibVersion VERSION = NmsLibVersion.V1736; + public static NmsLibVersion VERSION = NmsLibVersion.V206; static { AccessController.doPrivileged(new PrivilegedAction() { public Void run() { - System.loadLibrary(NmsLibVersion.V1736.indexLibraryVersion()); + System.loadLibrary(NmsLibVersion.V206.indexLibraryVersion()); return null; } }); From 8f583281e0571f1c11ba0c3842241e4cc2656930 Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 20:21:12 -0500 Subject: [PATCH 2/8] MNT: version in file name --- ...m_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h} | 0 ...amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename jni/include/{com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.h => com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h} (100%) rename jni/src/{com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.cpp => com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp} (100%) diff --git a/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.h b/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h similarity index 100% rename from jni/include/com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.h rename to jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h diff --git a/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.cpp b/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp similarity index 100% rename from jni/src/com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.cpp rename to jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp From 5cc58b3bb2c9764cd2bd903367767502fda52546 Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 20:21:45 -0500 Subject: [PATCH 3/8] MAINT: import path; version number --- jni/CMakeLists.txt | 6 +++--- jni/external/nmslib | 2 +- .../opendistroforelasticsearch/knn/index/KNNIndexCache.java | 2 +- .../opendistroforelasticsearch/knn/index/KNNWeight.java | 2 +- .../knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java | 2 +- .../knn/index/util/NmsLibVersion.java | 6 +++--- .../opendistroforelasticsearch/knn/index/v206/KNNIndex.java | 2 +- .../opendistroforelasticsearch/knn/index/KNNJNITests.java | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/jni/CMakeLists.txt b/jni/CMakeLists.txt index 303c5e62..0a10b249 100644 --- a/jni/CMakeLists.txt +++ b/jni/CMakeLists.txt @@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 2.8) -project(KNNIndexV1_7_3_6) +project(KNNIndexV2_0_6) # Corner case. For CMake 2.8, there is no option to specify set(CMAKE_CXX_STANDARD 11). Instead, the flag manually needs # to be set. @@ -27,7 +27,7 @@ else() endif() # Target Library to be built -set(KNN_INDEX KNNIndexV1_7_3_6) +set(KNN_INDEX KNNIndexV2_0_6) set(KNN_PACKAGE_NAME opendistro-knnlib) # Check if similarity search exists @@ -55,7 +55,7 @@ else() endif() # Compile the library -add_library(${KNN_INDEX} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.cpp) +add_library(${KNN_INDEX} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp) target_link_libraries(${KNN_INDEX} NonMetricSpaceLib) target_include_directories(${KNN_INDEX} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/${JVM_OS_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/external/nmslib/similarity_search/include) diff --git a/jni/external/nmslib b/jni/external/nmslib index 1eda05dc..5482e077 160000 --- a/jni/external/nmslib +++ b/jni/external/nmslib @@ -1 +1 @@ -Subproject commit 1eda05dccd5ed34df50a243dfc64c5e9187388f8 +Subproject commit 5482e077d1c8637499f86231bcd3979cb7fa6aef diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNIndexCache.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNIndexCache.java index ac128f6c..4a27423f 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNIndexCache.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNIndexCache.java @@ -15,7 +15,7 @@ package com.amazon.opendistroforelasticsearch.knn.index; -import com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex; +import com.amazon.opendistroforelasticsearch.knn.index.v206.KNNIndex; import com.amazon.opendistroforelasticsearch.knn.plugin.stats.StatNames; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java index a324d2a3..2f529c5a 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java @@ -16,7 +16,7 @@ package com.amazon.opendistroforelasticsearch.knn.index; import com.amazon.opendistroforelasticsearch.knn.index.codec.KNNCodecUtil; -import com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex; +import com.amazon.opendistroforelasticsearch.knn.index.v206.KNNIndex; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.index.FieldInfo; diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java index 40d1b7ec..ee527520 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/codec/KNN80Codec/KNN80DocValuesConsumer.java @@ -37,7 +37,7 @@ import com.amazon.opendistroforelasticsearch.knn.index.KNNVectorFieldMapper; import com.amazon.opendistroforelasticsearch.knn.index.util.KNNConstants; import com.amazon.opendistroforelasticsearch.knn.index.util.NmsLibVersion; -import com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex; +import com.amazon.opendistroforelasticsearch.knn.index.v206.KNNIndex; import java.io.Closeable; import java.io.IOException; diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/util/NmsLibVersion.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/util/NmsLibVersion.java index 9b861ce6..1ce2749c 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/util/NmsLibVersion.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/util/NmsLibVersion.java @@ -20,14 +20,14 @@ public enum NmsLibVersion { /** * Latest available nmslib version */ - V1736("1736"){ + V206("206"){ @Override public String indexLibraryVersion() { - return "KNNIndexV1_7_3_6"; + return "KNNIndexV2_0_6"; } }; - public static final NmsLibVersion LATEST = V1736; + public static final NmsLibVersion LATEST = V206; public String buildVersion; diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java index 6c43f05b..1998296b 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -package com.amazon.opendistroforelasticsearch.knn.index.v1736; +package com.amazon.opendistroforelasticsearch.knn.index.v206; import com.amazon.opendistroforelasticsearch.knn.index.KNNQueryResult; import com.amazon.opendistroforelasticsearch.knn.index.util.NmsLibVersion; diff --git a/src/test/java/com/amazon/opendistroforelasticsearch/knn/index/KNNJNITests.java b/src/test/java/com/amazon/opendistroforelasticsearch/knn/index/KNNJNITests.java index 422f7f6f..8519652f 100644 --- a/src/test/java/com/amazon/opendistroforelasticsearch/knn/index/KNNJNITests.java +++ b/src/test/java/com/amazon/opendistroforelasticsearch/knn/index/KNNJNITests.java @@ -16,7 +16,7 @@ package com.amazon.opendistroforelasticsearch.knn.index; import com.amazon.opendistroforelasticsearch.knn.KNNTestCase; -import com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex; +import com.amazon.opendistroforelasticsearch.knn.index.v206.KNNIndex; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; From 8a2f662bb2ba7e7b0200da77acc833e6e534b27c Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 20:24:54 -0500 Subject: [PATCH 4/8] FIX: include header file --- ...mazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp b/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp index 5c253c3a..fd4b356e 100644 --- a/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp +++ b/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -#include "com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex.h" +#include "com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h" #include "init.h" #include "index.h" From cf9c5a88dd5eb0f61313e568124d259ba343a7fb Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 20:32:41 -0500 Subject: [PATCH 5/8] FIX: change API method names --- ...forelasticsearch_knn_index_v206_KNNIndex.h | 53 ------------------- ...relasticsearch_knn_index_v206_KNNIndex.cpp | 10 ++-- 2 files changed, 5 insertions(+), 58 deletions(-) delete mode 100644 jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h diff --git a/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h b/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h deleted file mode 100644 index 11ad9414..00000000 --- a/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h +++ /dev/null @@ -1,53 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex */ - -#ifndef _Included_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex -#define _Included_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex - * Method: saveIndex - * Signature: ([I[[FLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_saveIndex - (JNIEnv *, jclass, jintArray, jobjectArray, jstring, jobjectArray, jstring); - -/* - * Class: com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex - * Method: queryIndex - * Signature: (J[FI)[Lcom/amazon/opendistroforelasticsearch/knn/index/KNNQueryResult; - */ -JNIEXPORT jobjectArray JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_queryIndex - (JNIEnv *, jclass, jlong, jfloatArray, jint); - -/* - * Class: com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex - * Method: init - * Signature: (Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)J - */ -JNIEXPORT jlong JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_init - (JNIEnv *, jclass, jstring, jobjectArray, jstring); - -/* - * Class: com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex - * Method: gc - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_gc - (JNIEnv *, jclass, jlong); - -/* - * Class: com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex - * Method: initLibrary - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_initLibrary - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp b/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp index fd4b356e..1494d0ea 100644 --- a/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp +++ b/jni/src/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.cpp @@ -85,7 +85,7 @@ void catch_cpp_exception_and_throw_java(JNIEnv* env) } } -JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_saveIndex(JNIEnv* env, jclass cls, jintArray ids, jobjectArray vectors, jstring indexPath, jobjectArray algoParams, jstring spaceType) +JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_saveIndex(JNIEnv* env, jclass cls, jintArray ids, jobjectArray vectors, jstring indexPath, jobjectArray algoParams, jstring spaceType) { Space* space = NULL; ObjectVector dataset; @@ -144,7 +144,7 @@ JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v173 } } -JNIEXPORT jobjectArray JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_queryIndex(JNIEnv* env, jclass cls, jlong indexPointer, jfloatArray queryVector, jint k) +JNIEXPORT jobjectArray JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_queryIndex(JNIEnv* env, jclass cls, jlong indexPointer, jfloatArray queryVector, jint k) { try { IndexWrapper *indexWrapper = reinterpret_cast(indexPointer); @@ -175,7 +175,7 @@ JNIEXPORT jobjectArray JNICALL Java_com_amazon_opendistroforelasticsearch_knn_in return NULL; } -JNIEXPORT jlong JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_init(JNIEnv* env, jclass cls, jstring indexPath, jobjectArray algoParams, jstring spaceType) +JNIEXPORT jlong JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_init(JNIEnv* env, jclass cls, jstring indexPath, jobjectArray algoParams, jstring spaceType) { IndexWrapper *indexWrapper = NULL; try { @@ -215,7 +215,7 @@ JNIEXPORT jlong JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v17 return NULL; } -JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_gc(JNIEnv* env, jclass cls, jlong indexPointer) +JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_gc(JNIEnv* env, jclass cls, jlong indexPointer) { try { IndexWrapper *indexWrapper = reinterpret_cast(indexPointer); @@ -228,7 +228,7 @@ JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v173 } } -JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v1736_KNNIndex_initLibrary(JNIEnv *, jclass) +JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_initLibrary(JNIEnv *, jclass) { initLibrary(); From 9209ae1bbe296c4d641a9531021c1e7e85259e6e Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 20:38:54 -0500 Subject: [PATCH 6/8] MAINT: replace .h file --- ...forelasticsearch_knn_index_v206_KNNIndex.h | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h diff --git a/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h b/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h new file mode 100644 index 00000000..43c88216 --- /dev/null +++ b/jni/include/com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex.h @@ -0,0 +1,53 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex */ + +#ifndef _Included_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex +#define _Included_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex + * Method: saveIndex + * Signature: ([I[[FLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_saveIndex + (JNIEnv *, jclass, jintArray, jobjectArray, jstring, jobjectArray, jstring); + +/* + * Class: com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex + * Method: queryIndex + * Signature: (J[FI)[Lcom/amazon/opendistroforelasticsearch/knn/index/KNNQueryResult; + */ +JNIEXPORT jobjectArray JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_queryIndex + (JNIEnv *, jclass, jlong, jfloatArray, jint); + +/* + * Class: com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex + * Method: init + * Signature: (Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_init + (JNIEnv *, jclass, jstring, jobjectArray, jstring); + +/* + * Class: com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex + * Method: gc + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_gc + (JNIEnv *, jclass, jlong); + +/* + * Class: com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex + * Method: initLibrary + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_com_amazon_opendistroforelasticsearch_knn_index_v206_KNNIndex_initLibrary + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif From d2047f242feefd88276191cd9458e87662f5e9d2 Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 21:06:20 -0500 Subject: [PATCH 7/8] MNT: clean versions --- .gitignore | 2 +- .../amazon/opendistroforelasticsearch/knn/index/KNNWeight.java | 2 +- .../opendistroforelasticsearch/knn/index/v206/KNNIndex.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 453e728a..6f6860f2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ build *.log out/ buildSrc/es-knn-offline-repo-* -buildSrc/libKNNIndexV1_7_3_6* +buildSrc/libKNNIndexV2_0_6* oss/* *.iml jni/CMakeCache.txt diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java index 2f529c5a..862ae877 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNWeight.java @@ -92,7 +92,7 @@ public Scorer scorer(LeafReaderContext context) throws IOException { /** * TODO Add logic to pick up the right nmslib version based on the version - * in the name of the file. As of now we have one version 1.7.3.6. + * in the name of the file. As of now we have one version 2.0.6 * So deferring this to future releases */ diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java index 1998296b..3a791491 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/v206/KNNIndex.java @@ -153,6 +153,6 @@ private static long computeFileSize(String indexPath) { // Deletes memory pointed to by index pointer (needs write lock) private static native void gc(long indexPointer); - // Calls nmslib's initLibrary function: https://github.com/nmslib/nmslib/blob/v1.7.3.6/similarity_search/include/init.h#L27 + // Calls nmslib's initLibrary function: https://github.com/nmslib/nmslib/blob/v2.0.6/similarity_search/include/init.h#L27 private static native void initLibrary(); } From f4f7bc02f9b93f038a5fe3a69b6d35a56d6fbb42 Mon Sep 17 00:00:00 2001 From: qchea Date: Mon, 6 Jul 2020 21:16:56 -0500 Subject: [PATCH 8/8] FIX: loadLibrary security --- src/main/plugin-metadata/plugin-security.policy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/plugin-metadata/plugin-security.policy b/src/main/plugin-metadata/plugin-security.policy index 0791896b..37e25294 100644 --- a/src/main/plugin-metadata/plugin-security.policy +++ b/src/main/plugin-metadata/plugin-security.policy @@ -1,3 +1,3 @@ grant { - permission java.lang.RuntimePermission "loadLibrary.KNNIndexV1_7_3_6"; + permission java.lang.RuntimePermission "loadLibrary.KNNIndexV2_0_6"; };