From e2d85966ecd01b499b86e878d06ba8ffb00088db Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Thu, 29 Jun 2023 19:24:20 +0300 Subject: [PATCH 1/6] update to use TileDB-2.16.0-rc0 and its bindings --- build.gradle | 2 +- cmake/Modules/FindTileDB_EP.cmake | 12 +- gradle.properties | 2 +- src/main/c/generated/tiledb_wrap.cxx | 880 ++++++++++-------- ...TYPE_p_p_tiledb_buffer_list_handle_t.java} | 8 +- ...IGTYPE_p_tiledb_buffer_list_handle_t.java} | 8 +- src/main/java/io/tiledb/libtiledb/tiledb.java | 355 ++++--- .../io/tiledb/libtiledb/tiledbConstants.java | 2 +- .../java/io/tiledb/libtiledb/tiledbJNI.java | 96 +- .../libtiledb/tiledb_filter_option_t.java | 3 +- .../libtiledb/tiledb_filter_type_t.java | 3 +- .../libtiledb/tiledb_query_status_t.java | 3 +- .../io/tiledb/java/api/ArraySchemaTest.java | 2 +- .../java/io/tiledb/java/api/VersionTest.java | 6 +- swig/tiledb.i | 50 +- 15 files changed, 806 insertions(+), 626 deletions(-) rename src/main/java/io/tiledb/libtiledb/{SWIGTYPE_p_p_tiledb_buffer_list_t.java => SWIGTYPE_p_p_tiledb_buffer_list_handle_t.java} (78%) rename src/main/java/io/tiledb/libtiledb/{SWIGTYPE_p_tiledb_buffer_list_t.java => SWIGTYPE_p_tiledb_buffer_list_handle_t.java} (71%) diff --git a/build.gradle b/build.gradle index 44aef316..1b4d5aa5 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } group 'io.tiledb' -version '0.17.9-SNAPSHOT' +version '0.18.0-SNAPSHOT' repositories { jcenter() diff --git a/cmake/Modules/FindTileDB_EP.cmake b/cmake/Modules/FindTileDB_EP.cmake index 5abca683..bd48c659 100644 --- a/cmake/Modules/FindTileDB_EP.cmake +++ b/cmake/Modules/FindTileDB_EP.cmake @@ -48,14 +48,14 @@ if (NOT TILEDB_FOUND) # Try to download prebuilt artifacts unless the user specifies to build from source if(DOWNLOAD_TILEDB_PREBUILT) if (WIN32) # Windows - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.15.4/tiledb-windows-x86_64-2.15.4-57c9edf.zip") - SET(DOWNLOAD_SHA1 "6cabf3049fcd11a96a93704870b15774343b563f") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.0-rc0/tiledb-windows-x86_64-2.16.0-rc0-d4a37a6.zip") + SET(DOWNLOAD_SHA1 "5237ce7dcfa07d629e00a32c41f366e4a52a11f2") elseif(APPLE) # macOS - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.15.4/tiledb-macos-x86_64-2.15.4-57c9edf.tar.gz") - SET(DOWNLOAD_SHA1 "ca7ef10b01715e277387532591fd4bff8efb1689") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.0-rc0/tiledb-macos-x86_64-2.16.0-rc0-d4a37a6.tar.gz") + SET(DOWNLOAD_SHA1 "619741d8a8936e0fb6bc19ace9c111c29dfe226a") else() # Linux - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.15.4/tiledb-linux-x86_64-2.15.4-57c9edf.tar.gz") - SET(DOWNLOAD_SHA1 "19397dbfef46d796d11f4d8bb80f7bd01230e0a6") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.0-rc0/tiledb-linux-x86_64-2.16.0-rc0-d4a37a6.tar.gz") + SET(DOWNLOAD_SHA1 "c8ddba2c0f7bfecbb8df62d67ba1b7d98b79d000") endif() ExternalProject_Add(ep_tiledb diff --git a/gradle.properties b/gradle.properties index 409b94fd..11f414ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ TILEDB_GIT_REPOSITORY=https://github.com/TileDB-Inc/TileDB -TILEDB_GIT_TAG=2.15.4 +TILEDB_GIT_TAG=2.16.0-rc0 TILEDB_VERBOSE=ON TILEDB_S3=ON TILEDB_AZURE=OFF diff --git a/src/main/c/generated/tiledb_wrap.cxx b/src/main/c/generated/tiledb_wrap.cxx index 91f644b5..1b09330d 100644 --- a/src/main/c/generated/tiledb_wrap.cxx +++ b/src/main/c/generated/tiledb_wrap.cxx @@ -241,9 +241,6 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC #include "tiledb_java_extensions.h" -#include // Use the C99 official header - - typedef int32_t int32_tArray; SWIGINTERN int32_tArray *new_int32_tArray(int nelements){ @@ -6333,6 +6330,131 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1set_ } +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_buffer_list_t **arg2 = (tiledb_buffer_list_t **) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_buffer_list_t ***)&jarg2; + result = tiledb_buffer_list_alloc(arg1,arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1free(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tiledb_buffer_list_t **arg1 = (tiledb_buffer_list_t **) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_buffer_list_t ***)&jarg1; + tiledb_buffer_list_free(arg1); +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1get_1num_1buffers(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; + uint64_t *arg3 = (uint64_t *) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_buffer_list_t **)&jarg2; + arg3 = *(uint64_t **)&jarg3; + result = tiledb_buffer_list_get_num_buffers(arg1,(tiledb_buffer_list_handle_t const *)arg2,arg3); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1get_1buffer(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jlong jarg4) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; + uint64_t arg3 ; + tiledb_buffer_t **arg4 = (tiledb_buffer_t **) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_buffer_list_t **)&jarg2; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg3); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg3 = 0; + if (sz > 0) { + arg3 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg4 = *(tiledb_buffer_t ***)&jarg4; + result = tiledb_buffer_list_get_buffer(arg1,(tiledb_buffer_list_handle_t const *)arg2,arg3,arg4); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1get_1total_1size(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; + uint64_t *arg3 = (uint64_t *) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_buffer_list_t **)&jarg2; + arg3 = *(uint64_t **)&jarg3; + result = tiledb_buffer_list_get_total_size(arg1,(tiledb_buffer_list_handle_t const *)arg2,arg3); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1flatten(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; + tiledb_buffer_t **arg3 = (tiledb_buffer_t **) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_buffer_list_t **)&jarg2; + arg3 = *(tiledb_buffer_t ***)&jarg3; + result = tiledb_buffer_list_flatten(arg1,arg2,arg3); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1data_1order_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { jlong jresult = 0 ; tiledb_data_order_t arg1 ; @@ -6648,11 +6770,39 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1filter_1list } -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1group_1create(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) { +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_sys_1nerr_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + result = (int)(int)sys_nerr; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_sys_1errlist_1get(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; + char **result = 0 ; + + (void)jenv; + (void)jcls; + result = (char **)(char **)sys_errlist; + *(char ***)&jresult = result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3, jlong jarg4, jlong jarg5, jlong jarg6) { + jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; char *arg2 = (char *) 0 ; - SwigValueWrapper< capi_return_t > result; + tiledb_datatype_t arg3 ; + void *arg4 = (void *) 0 ; + void *arg5 = (void *) 0 ; + tiledb_dimension_t **arg6 = (tiledb_dimension_t **) 0 ; + int32_t result; (void)jenv; (void)jcls; @@ -6662,103 +6812,300 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1group_1creat arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } - result = tiledb_group_create(arg1,(char const *)arg2); - *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + arg3 = (tiledb_datatype_t)jarg3; + arg4 = *(void **)&jarg4; + arg5 = *(void **)&jarg5; + arg6 = *(tiledb_dimension_t ***)&jarg6; + result = (int32_t)tiledb_dimension_alloc(arg1,(char const *)arg2,arg3,(void const *)arg4,(void const *)arg5,arg6); + jresult = (jint)result; if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1object_1type_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { - jlong jresult = 0 ; - tiledb_object_t arg1 ; - char **arg2 = (char **) 0 ; - SwigValueWrapper< capi_return_t > result; +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1free(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tiledb_dimension_t **arg1 = (tiledb_dimension_t **) 0 ; (void)jenv; (void)jcls; - arg1 = (tiledb_object_t)jarg1; - arg2 = *(char ***)&jarg2; - result = tiledb_object_type_to_str(arg1,(char const **)arg2); - *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); - return jresult; + arg1 = *(tiledb_dimension_t ***)&jarg1; + tiledb_dimension_free(arg1); } -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1object_1type_1from_1str(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - tiledb_object_t *arg2 = (tiledb_object_t *) 0 ; - SwigValueWrapper< capi_return_t > result; +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1set_1filter_1list(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + tiledb_filter_list_t *arg3 = (tiledb_filter_list_t *) 0 ; + int32_t result; (void)jenv; (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = *(tiledb_object_t **)&jarg2; - result = tiledb_object_type_from_str((char const *)arg1,arg2); - *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(tiledb_filter_list_t **)&jarg3; + result = (int32_t)tiledb_dimension_set_filter_list(arg1,arg2,arg3); + jresult = (jint)result; return jresult; } -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1walk_1order_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { - jlong jresult = 0 ; - tiledb_walk_order_t arg1 ; - char **arg2 = (char **) 0 ; - SwigValueWrapper< capi_return_t > result; +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1set_1cell_1val_1num(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + uint32_t arg3 ; + int32_t result; (void)jenv; (void)jcls; - arg1 = (tiledb_walk_order_t)jarg1; - arg2 = *(char ***)&jarg2; - result = tiledb_walk_order_to_str(arg1,(char const **)arg2); - *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = (uint32_t)jarg3; + result = (int32_t)tiledb_dimension_set_cell_val_num(arg1,arg2,arg3); + jresult = (jint)result; return jresult; } -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1walk_1order_1from_1str(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - tiledb_walk_order_t *arg2 = (tiledb_walk_order_t *) 0 ; - SwigValueWrapper< capi_return_t > result; +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1filter_1list(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + tiledb_filter_list_t **arg3 = (tiledb_filter_list_t **) 0 ; + int32_t result; (void)jenv; (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = *(tiledb_walk_order_t **)&jarg2; - result = tiledb_walk_order_from_str((char const *)arg1,arg2); - *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(tiledb_filter_list_t ***)&jarg3; + result = (int32_t)tiledb_dimension_get_filter_list(arg1,arg2,arg3); + jresult = (jint)result; return jresult; } -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1type_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { - jlong jresult = 0 ; - tiledb_query_type_t arg1 ; - char **arg2 = (char **) 0 ; - SwigValueWrapper< capi_return_t > result; +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1cell_1val_1num(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + uint32_t *arg3 = (uint32_t *) 0 ; + int32_t result; (void)jenv; (void)jcls; - arg1 = (tiledb_query_type_t)jarg1; - arg2 = *(char ***)&jarg2; - result = tiledb_query_type_to_str(arg1,(char const **)arg2); - *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); - return jresult; -} - - + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(uint32_t **)&jarg3; + result = (int32_t)tiledb_dimension_get_cell_val_num(arg1,(tiledb_dimension_t const *)arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + char **arg3 = (char **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(char ***)&jarg3; + result = (int32_t)tiledb_dimension_get_name(arg1,(tiledb_dimension_t const *)arg2,(char const **)arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + tiledb_datatype_t *arg3 = (tiledb_datatype_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(tiledb_datatype_t **)&jarg3; + result = (int32_t)tiledb_dimension_get_type(arg1,(tiledb_dimension_t const *)arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1domain(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + void **arg3 = (void **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(void ***)&jarg3; + result = (int32_t)tiledb_dimension_get_domain(arg1,(tiledb_dimension_t const *)arg2,(void const **)arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1tile_1extent(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + void **arg3 = (void **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(void ***)&jarg3; + result = (int32_t)tiledb_dimension_get_tile_extent(arg1,(tiledb_dimension_t const *)arg2,(void const **)arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1dump(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; + FILE *arg3 = (FILE *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_dimension_t **)&jarg2; + arg3 = *(FILE **)&jarg3; + result = (int32_t)tiledb_dimension_dump(arg1,(tiledb_dimension_t const *)arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1group_1create(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + char *arg2 = (char *) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + result = tiledb_group_create(arg1,(char const *)arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1object_1type_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { + jlong jresult = 0 ; + tiledb_object_t arg1 ; + char **arg2 = (char **) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = (tiledb_object_t)jarg1; + arg2 = *(char ***)&jarg2; + result = tiledb_object_type_to_str(arg1,(char const **)arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1object_1type_1from_1str(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { + jlong jresult = 0 ; + char *arg1 = (char *) 0 ; + tiledb_object_t *arg2 = (tiledb_object_t *) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); + if (!arg1) return 0; + } + arg2 = *(tiledb_object_t **)&jarg2; + result = tiledb_object_type_from_str((char const *)arg1,arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1walk_1order_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { + jlong jresult = 0 ; + tiledb_walk_order_t arg1 ; + char **arg2 = (char **) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = (tiledb_walk_order_t)jarg1; + arg2 = *(char ***)&jarg2; + result = tiledb_walk_order_to_str(arg1,(char const **)arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1walk_1order_1from_1str(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { + jlong jresult = 0 ; + char *arg1 = (char *) 0 ; + tiledb_walk_order_t *arg2 = (tiledb_walk_order_t *) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); + if (!arg1) return 0; + } + arg2 = *(tiledb_walk_order_t **)&jarg2; + result = tiledb_walk_order_from_str((char const *)arg1,arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1type_1to_1str(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { + jlong jresult = 0 ; + tiledb_query_type_t arg1 ; + char **arg2 = (char **) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = (tiledb_query_type_t)jarg1; + arg2 = *(char ***)&jarg2; + result = tiledb_query_type_to_str(arg1,(char const **)arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1type_1from_1str(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { jlong jresult = 0 ; char *arg1 = (char *) 0 ; @@ -7802,139 +8149,14 @@ SWIGEXPORT jstring JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1timestamps SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1version(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { int32_t *arg1 = (int32_t *) 0 ; int32_t *arg2 = (int32_t *) 0 ; - int32_t *arg3 = (int32_t *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(int32_t **)&jarg1; - arg2 = *(int32_t **)&jarg2; - arg3 = *(int32_t **)&jarg3; - tiledb_version(arg1,arg2,arg3); -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_buffer_list_t **arg2 = (tiledb_buffer_list_t **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_buffer_list_t ***)&jarg2; - result = (int32_t)tiledb_buffer_list_alloc(arg1,arg2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1free(JNIEnv *jenv, jclass jcls, jlong jarg1) { - tiledb_buffer_list_t **arg1 = (tiledb_buffer_list_t **) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_buffer_list_t ***)&jarg1; - tiledb_buffer_list_free(arg1); -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1get_1num_1buffers(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; - uint64_t *arg3 = (uint64_t *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_buffer_list_t **)&jarg2; - arg3 = *(uint64_t **)&jarg3; - result = (int32_t)tiledb_buffer_list_get_num_buffers(arg1,(tiledb_buffer_list_t const *)arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1get_1buffer(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jlong jarg4) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; - uint64_t arg3 ; - tiledb_buffer_t **arg4 = (tiledb_buffer_t **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_buffer_list_t **)&jarg2; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = *(tiledb_buffer_t ***)&jarg4; - result = (int32_t)tiledb_buffer_list_get_buffer(arg1,(tiledb_buffer_list_t const *)arg2,arg3,arg4); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1get_1total_1size(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; - uint64_t *arg3 = (uint64_t *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_buffer_list_t **)&jarg2; - arg3 = *(uint64_t **)&jarg3; - result = (int32_t)tiledb_buffer_list_get_total_size(arg1,(tiledb_buffer_list_t const *)arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1buffer_1list_1flatten(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_buffer_list_t *arg2 = (tiledb_buffer_list_t *) 0 ; - tiledb_buffer_t **arg3 = (tiledb_buffer_t **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_buffer_list_t **)&jarg2; - arg3 = *(tiledb_buffer_t ***)&jarg3; - result = (int32_t)tiledb_buffer_list_flatten(arg1,(tiledb_buffer_list_t const *)arg2,arg3); - jresult = (jint)result; - return jresult; + int32_t *arg3 = (int32_t *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(int32_t **)&jarg1; + arg2 = *(int32_t **)&jarg2; + arg3 = *(int32_t **)&jarg3; + tiledb_version(arg1,arg2,arg3); } @@ -8455,207 +8677,6 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1domain_1dump( } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3, jlong jarg4, jlong jarg5, jlong jarg6) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - char *arg2 = (char *) 0 ; - tiledb_datatype_t arg3 ; - void *arg4 = (void *) 0 ; - void *arg5 = (void *) 0 ; - tiledb_dimension_t **arg6 = (tiledb_dimension_t **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (tiledb_datatype_t)jarg3; - arg4 = *(void **)&jarg4; - arg5 = *(void **)&jarg5; - arg6 = *(tiledb_dimension_t ***)&jarg6; - result = (int32_t)tiledb_dimension_alloc(arg1,(char const *)arg2,arg3,(void const *)arg4,(void const *)arg5,arg6); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1free(JNIEnv *jenv, jclass jcls, jlong jarg1) { - tiledb_dimension_t **arg1 = (tiledb_dimension_t **) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_dimension_t ***)&jarg1; - tiledb_dimension_free(arg1); -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1set_1filter_1list(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - tiledb_filter_list_t *arg3 = (tiledb_filter_list_t *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(tiledb_filter_list_t **)&jarg3; - result = (int32_t)tiledb_dimension_set_filter_list(arg1,arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1set_1cell_1val_1num(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - uint32_t arg3 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = (uint32_t)jarg3; - result = (int32_t)tiledb_dimension_set_cell_val_num(arg1,arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1filter_1list(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - tiledb_filter_list_t **arg3 = (tiledb_filter_list_t **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(tiledb_filter_list_t ***)&jarg3; - result = (int32_t)tiledb_dimension_get_filter_list(arg1,arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1cell_1val_1num(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - uint32_t *arg3 = (uint32_t *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(uint32_t **)&jarg3; - result = (int32_t)tiledb_dimension_get_cell_val_num(arg1,(tiledb_dimension_t const *)arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - char **arg3 = (char **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(char ***)&jarg3; - result = (int32_t)tiledb_dimension_get_name(arg1,(tiledb_dimension_t const *)arg2,(char const **)arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - tiledb_datatype_t *arg3 = (tiledb_datatype_t *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(tiledb_datatype_t **)&jarg3; - result = (int32_t)tiledb_dimension_get_type(arg1,(tiledb_dimension_t const *)arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1domain(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - void **arg3 = (void **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(void ***)&jarg3; - result = (int32_t)tiledb_dimension_get_domain(arg1,(tiledb_dimension_t const *)arg2,(void const **)arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1get_1tile_1extent(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - void **arg3 = (void **) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(void ***)&jarg3; - result = (int32_t)tiledb_dimension_get_tile_extent(arg1,(tiledb_dimension_t const *)arg2,(void const **)arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1dump(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_dimension_t *arg2 = (tiledb_dimension_t *) 0 ; - FILE *arg3 = (FILE *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_dimension_t **)&jarg2; - arg3 = *(FILE **)&jarg3; - result = (int32_t)tiledb_dimension_dump(arg1,(tiledb_dimension_t const *)arg2,arg3); - jresult = (jint)result; - return jresult; -} - - SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jlong jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -9972,6 +9993,24 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1condit } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1condition_1negate(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_query_condition_t *arg2 = (tiledb_query_condition_t *) 0 ; + tiledb_query_condition_t **arg3 = (tiledb_query_condition_t **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_query_condition_t **)&jarg2; + arg3 = *(tiledb_query_condition_t ***)&jarg3; + result = (int32_t)tiledb_query_condition_negate(arg1,(tiledb_query_condition_t const *)arg2,arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -13206,6 +13245,24 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1group_1vacuu } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1get_1plan(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_query_t *arg2 = (tiledb_query_t *) 0 ; + tiledb_string_t **arg3 = (tiledb_string_t **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_query_t **)&jarg2; + arg3 = *(tiledb_string_t ***)&jarg3; + result = (int32_t)tiledb_query_get_plan(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1label_1free(JNIEnv *jenv, jclass jcls, jlong jarg1) { tiledb_dimension_label_t **arg1 = (tiledb_dimension_label_t **) 0 ; @@ -13812,6 +13869,27 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1ha } +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1log_1warn(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) { + jlong jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + char *arg2 = (char *) 0 ; + SwigValueWrapper< capi_return_t > result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + result = tiledb_log_warn(arg1,(char const *)arg2); + *(capi_return_t **)&jresult = new capi_return_t((const capi_return_t &)result); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema_1evolution_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; diff --git a/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_buffer_list_t.java b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_buffer_list_handle_t.java similarity index 78% rename from src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_buffer_list_t.java rename to src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_buffer_list_handle_t.java index 5d1f6a35..22bc9bc5 100644 --- a/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_buffer_list_t.java +++ b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_buffer_list_handle_t.java @@ -8,19 +8,19 @@ package io.tiledb.libtiledb; -public class SWIGTYPE_p_p_tiledb_buffer_list_t { +public class SWIGTYPE_p_p_tiledb_buffer_list_handle_t { private transient long swigCPtr; - protected SWIGTYPE_p_p_tiledb_buffer_list_t( + protected SWIGTYPE_p_p_tiledb_buffer_list_handle_t( long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } - protected SWIGTYPE_p_p_tiledb_buffer_list_t() { + protected SWIGTYPE_p_p_tiledb_buffer_list_handle_t() { swigCPtr = 0; } - protected static long getCPtr(SWIGTYPE_p_p_tiledb_buffer_list_t obj) { + protected static long getCPtr(SWIGTYPE_p_p_tiledb_buffer_list_handle_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } } diff --git a/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_buffer_list_t.java b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_buffer_list_handle_t.java similarity index 71% rename from src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_buffer_list_t.java rename to src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_buffer_list_handle_t.java index 7dc5727b..a9569799 100644 --- a/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_buffer_list_t.java +++ b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_buffer_list_handle_t.java @@ -8,19 +8,19 @@ package io.tiledb.libtiledb; -public class SWIGTYPE_p_tiledb_buffer_list_t { +public class SWIGTYPE_p_tiledb_buffer_list_handle_t { private transient long swigCPtr; - protected SWIGTYPE_p_tiledb_buffer_list_t( + protected SWIGTYPE_p_tiledb_buffer_list_handle_t( long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } - protected SWIGTYPE_p_tiledb_buffer_list_t() { + protected SWIGTYPE_p_tiledb_buffer_list_handle_t() { swigCPtr = 0; } - protected static long getCPtr(SWIGTYPE_p_tiledb_buffer_list_t obj) { + protected static long getCPtr(SWIGTYPE_p_tiledb_buffer_list_handle_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } } diff --git a/src/main/java/io/tiledb/libtiledb/tiledb.java b/src/main/java/io/tiledb/libtiledb/tiledb.java index 677a2c66..70a2ede0 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb.java @@ -1731,6 +1731,70 @@ public static capi_return_t tiledb_buffer_set_data( true); } + public static capi_return_t tiledb_buffer_list_alloc( + SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_p_tiledb_buffer_list_handle_t buffer_list) { + return new capi_return_t( + tiledbJNI.tiledb_buffer_list_alloc( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_p_tiledb_buffer_list_handle_t.getCPtr(buffer_list)), + true); + } + + public static void tiledb_buffer_list_free(SWIGTYPE_p_p_tiledb_buffer_list_handle_t buffer_list) { + tiledbJNI.tiledb_buffer_list_free( + SWIGTYPE_p_p_tiledb_buffer_list_handle_t.getCPtr(buffer_list)); + } + + public static capi_return_t tiledb_buffer_list_get_num_buffers( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_buffer_list_handle_t buffer_list, + SWIGTYPE_p_unsigned_long_long num_buffers) { + return new capi_return_t( + tiledbJNI.tiledb_buffer_list_get_num_buffers( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_buffer_list_handle_t.getCPtr(buffer_list), + SWIGTYPE_p_unsigned_long_long.getCPtr(num_buffers)), + true); + } + + public static capi_return_t tiledb_buffer_list_get_buffer( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_buffer_list_handle_t buffer_list, + java.math.BigInteger buffer_idx, + SWIGTYPE_p_p_tiledb_buffer_handle_t buffer) { + return new capi_return_t( + tiledbJNI.tiledb_buffer_list_get_buffer( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_buffer_list_handle_t.getCPtr(buffer_list), + buffer_idx, + SWIGTYPE_p_p_tiledb_buffer_handle_t.getCPtr(buffer)), + true); + } + + public static capi_return_t tiledb_buffer_list_get_total_size( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_buffer_list_handle_t buffer_list, + SWIGTYPE_p_unsigned_long_long total_size) { + return new capi_return_t( + tiledbJNI.tiledb_buffer_list_get_total_size( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_buffer_list_handle_t.getCPtr(buffer_list), + SWIGTYPE_p_unsigned_long_long.getCPtr(total_size)), + true); + } + + public static capi_return_t tiledb_buffer_list_flatten( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_buffer_list_handle_t buffer_list, + SWIGTYPE_p_p_tiledb_buffer_handle_t buffer) { + return new capi_return_t( + tiledbJNI.tiledb_buffer_list_flatten( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_buffer_list_handle_t.getCPtr(buffer_list), + SWIGTYPE_p_p_tiledb_buffer_handle_t.getCPtr(buffer)), + true); + } + public static capi_return_t tiledb_data_order_to_str( tiledb_data_order_t data_order, SWIGTYPE_p_p_char str) { return new capi_return_t( @@ -1908,6 +1972,117 @@ public static capi_return_t tiledb_filter_list_get_max_chunk_size( true); } + public static int getSys_nerr() { + return tiledbJNI.sys_nerr_get(); + } + + public static SWIGTYPE_p_p_char getSys_errlist() { + long cPtr = tiledbJNI.sys_errlist_get(); + return (cPtr == 0) ? null : new SWIGTYPE_p_p_char(cPtr, false); + } + + public static int tiledb_dimension_alloc( + SWIGTYPE_p_tiledb_ctx_t ctx, + String name, + tiledb_datatype_t type, + SWIGTYPE_p_void dim_domain, + SWIGTYPE_p_void tile_extent, + SWIGTYPE_p_p_tiledb_dimension_t dim) { + return tiledbJNI.tiledb_dimension_alloc( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + name, + type.swigValue(), + SWIGTYPE_p_void.getCPtr(dim_domain), + SWIGTYPE_p_void.getCPtr(tile_extent), + SWIGTYPE_p_p_tiledb_dimension_t.getCPtr(dim)); + } + + public static void tiledb_dimension_free(SWIGTYPE_p_p_tiledb_dimension_t dim) { + tiledbJNI.tiledb_dimension_free(SWIGTYPE_p_p_tiledb_dimension_t.getCPtr(dim)); + } + + public static int tiledb_dimension_set_filter_list( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_dimension_t dim, + SWIGTYPE_p_tiledb_filter_list_handle_t filter_list) { + return tiledbJNI.tiledb_dimension_set_filter_list( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_tiledb_filter_list_handle_t.getCPtr(filter_list)); + } + + public static int tiledb_dimension_set_cell_val_num( + SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, long cell_val_num) { + return tiledbJNI.tiledb_dimension_set_cell_val_num( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + cell_val_num); + } + + public static int tiledb_dimension_get_filter_list( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_dimension_t dim, + SWIGTYPE_p_p_tiledb_filter_list_handle_t filter_list) { + return tiledbJNI.tiledb_dimension_get_filter_list( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_p_tiledb_filter_list_handle_t.getCPtr(filter_list)); + } + + public static int tiledb_dimension_get_cell_val_num( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_dimension_t dim, + SWIGTYPE_p_unsigned_int cell_val_num) { + return tiledbJNI.tiledb_dimension_get_cell_val_num( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_unsigned_int.getCPtr(cell_val_num)); + } + + public static int tiledb_dimension_get_name( + SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, SWIGTYPE_p_p_char name) { + return tiledbJNI.tiledb_dimension_get_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_p_char.getCPtr(name)); + } + + public static int tiledb_dimension_get_type( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_dimension_t dim, + SWIGTYPE_p_tiledb_datatype_t type) { + return tiledbJNI.tiledb_dimension_get_type( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_tiledb_datatype_t.getCPtr(type)); + } + + public static int tiledb_dimension_get_domain( + SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, SWIGTYPE_p_p_void domain) { + return tiledbJNI.tiledb_dimension_get_domain( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_p_void.getCPtr(domain)); + } + + public static int tiledb_dimension_get_tile_extent( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_dimension_t dim, + SWIGTYPE_p_p_void tile_extent) { + return tiledbJNI.tiledb_dimension_get_tile_extent( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_p_void.getCPtr(tile_extent)); + } + + public static int tiledb_dimension_dump( + SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, SWIGTYPE_p_FILE out) { + return tiledbJNI.tiledb_dimension_dump( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), + SWIGTYPE_p_FILE.getCPtr(out)); + } + public static capi_return_t tiledb_group_create(SWIGTYPE_p_tiledb_ctx_t ctx, String group_uri) { return new capi_return_t( tiledbJNI.tiledb_group_create(SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), group_uri), true); @@ -2375,59 +2550,6 @@ public static void tiledb_version( SWIGTYPE_p_int.getCPtr(major), SWIGTYPE_p_int.getCPtr(minor), SWIGTYPE_p_int.getCPtr(rev)); } - public static int tiledb_buffer_list_alloc( - SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_p_tiledb_buffer_list_t buffer_list) { - return tiledbJNI.tiledb_buffer_list_alloc( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_p_tiledb_buffer_list_t.getCPtr(buffer_list)); - } - - public static void tiledb_buffer_list_free(SWIGTYPE_p_p_tiledb_buffer_list_t buffer_list) { - tiledbJNI.tiledb_buffer_list_free(SWIGTYPE_p_p_tiledb_buffer_list_t.getCPtr(buffer_list)); - } - - public static int tiledb_buffer_list_get_num_buffers( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_buffer_list_t buffer_list, - SWIGTYPE_p_unsigned_long_long num_buffers) { - return tiledbJNI.tiledb_buffer_list_get_num_buffers( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_buffer_list_t.getCPtr(buffer_list), - SWIGTYPE_p_unsigned_long_long.getCPtr(num_buffers)); - } - - public static int tiledb_buffer_list_get_buffer( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_buffer_list_t buffer_list, - java.math.BigInteger buffer_idx, - SWIGTYPE_p_p_tiledb_buffer_handle_t buffer) { - return tiledbJNI.tiledb_buffer_list_get_buffer( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_buffer_list_t.getCPtr(buffer_list), - buffer_idx, - SWIGTYPE_p_p_tiledb_buffer_handle_t.getCPtr(buffer)); - } - - public static int tiledb_buffer_list_get_total_size( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_buffer_list_t buffer_list, - SWIGTYPE_p_unsigned_long_long total_size) { - return tiledbJNI.tiledb_buffer_list_get_total_size( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_buffer_list_t.getCPtr(buffer_list), - SWIGTYPE_p_unsigned_long_long.getCPtr(total_size)); - } - - public static int tiledb_buffer_list_flatten( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_buffer_list_t buffer_list, - SWIGTYPE_p_p_tiledb_buffer_handle_t buffer) { - return tiledbJNI.tiledb_buffer_list_flatten( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_buffer_list_t.getCPtr(buffer_list), - SWIGTYPE_p_p_tiledb_buffer_handle_t.getCPtr(buffer)); - } - public static int tiledb_attribute_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, String name, @@ -2672,108 +2794,6 @@ public static int tiledb_domain_dump( SWIGTYPE_p_FILE.getCPtr(out)); } - public static int tiledb_dimension_alloc( - SWIGTYPE_p_tiledb_ctx_t ctx, - String name, - tiledb_datatype_t type, - SWIGTYPE_p_void dim_domain, - SWIGTYPE_p_void tile_extent, - SWIGTYPE_p_p_tiledb_dimension_t dim) { - return tiledbJNI.tiledb_dimension_alloc( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - name, - type.swigValue(), - SWIGTYPE_p_void.getCPtr(dim_domain), - SWIGTYPE_p_void.getCPtr(tile_extent), - SWIGTYPE_p_p_tiledb_dimension_t.getCPtr(dim)); - } - - public static void tiledb_dimension_free(SWIGTYPE_p_p_tiledb_dimension_t dim) { - tiledbJNI.tiledb_dimension_free(SWIGTYPE_p_p_tiledb_dimension_t.getCPtr(dim)); - } - - public static int tiledb_dimension_set_filter_list( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_dimension_t dim, - SWIGTYPE_p_tiledb_filter_list_handle_t filter_list) { - return tiledbJNI.tiledb_dimension_set_filter_list( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_tiledb_filter_list_handle_t.getCPtr(filter_list)); - } - - public static int tiledb_dimension_set_cell_val_num( - SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, long cell_val_num) { - return tiledbJNI.tiledb_dimension_set_cell_val_num( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - cell_val_num); - } - - public static int tiledb_dimension_get_filter_list( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_dimension_t dim, - SWIGTYPE_p_p_tiledb_filter_list_handle_t filter_list) { - return tiledbJNI.tiledb_dimension_get_filter_list( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_p_tiledb_filter_list_handle_t.getCPtr(filter_list)); - } - - public static int tiledb_dimension_get_cell_val_num( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_dimension_t dim, - SWIGTYPE_p_unsigned_int cell_val_num) { - return tiledbJNI.tiledb_dimension_get_cell_val_num( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_unsigned_int.getCPtr(cell_val_num)); - } - - public static int tiledb_dimension_get_name( - SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, SWIGTYPE_p_p_char name) { - return tiledbJNI.tiledb_dimension_get_name( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_p_char.getCPtr(name)); - } - - public static int tiledb_dimension_get_type( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_dimension_t dim, - SWIGTYPE_p_tiledb_datatype_t type) { - return tiledbJNI.tiledb_dimension_get_type( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_tiledb_datatype_t.getCPtr(type)); - } - - public static int tiledb_dimension_get_domain( - SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, SWIGTYPE_p_p_void domain) { - return tiledbJNI.tiledb_dimension_get_domain( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_p_void.getCPtr(domain)); - } - - public static int tiledb_dimension_get_tile_extent( - SWIGTYPE_p_tiledb_ctx_t ctx, - SWIGTYPE_p_tiledb_dimension_t dim, - SWIGTYPE_p_p_void tile_extent) { - return tiledbJNI.tiledb_dimension_get_tile_extent( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_p_void.getCPtr(tile_extent)); - } - - public static int tiledb_dimension_dump( - SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim, SWIGTYPE_p_FILE out) { - return tiledbJNI.tiledb_dimension_dump( - SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), - SWIGTYPE_p_tiledb_dimension_t.getCPtr(dim), - SWIGTYPE_p_FILE.getCPtr(out)); - } - public static int tiledb_array_schema_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, tiledb_array_type_t array_type, @@ -3411,6 +3431,16 @@ public static int tiledb_query_condition_combine( SWIGTYPE_p_p_tiledb_query_condition_t.getCPtr(combined_cond)); } + public static int tiledb_query_condition_negate( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_query_condition_t cond, + SWIGTYPE_p_p_tiledb_query_condition_t negated_cond) { + return tiledbJNI.tiledb_query_condition_negate( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_query_condition_t.getCPtr(cond), + SWIGTYPE_p_p_tiledb_query_condition_t.getCPtr(negated_cond)); + } + public static int tiledb_subarray_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_array_t array, @@ -4884,6 +4914,16 @@ public static capi_return_t tiledb_group_vacuum_metadata( true); } + public static int tiledb_query_get_plan( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_query_t query, + SWIGTYPE_p_p_tiledb_string_handle_t plan) { + return tiledbJNI.tiledb_query_get_plan( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_query_t.getCPtr(query), + SWIGTYPE_p_p_tiledb_string_handle_t.getCPtr(plan)); + } + public static void tiledb_dimension_label_free( SWIGTYPE_p_p_tiledb_dimension_label_handle_t dim_label) { tiledbJNI.tiledb_dimension_label_free( @@ -5186,6 +5226,11 @@ public static capi_return_t tiledb_subarray_has_label_ranges( true); } + public static capi_return_t tiledb_log_warn(SWIGTYPE_p_tiledb_ctx_t ctx, String message) { + return new capi_return_t( + tiledbJNI.tiledb_log_warn(SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), message), true); + } + public static int tiledb_array_schema_evolution_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_p_tiledb_array_schema_evolution_t array_schema_evolution) { diff --git a/src/main/java/io/tiledb/libtiledb/tiledbConstants.java b/src/main/java/io/tiledb/libtiledb/tiledbConstants.java index 576fcf74..085cd3bc 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledbConstants.java +++ b/src/main/java/io/tiledb/libtiledb/tiledbConstants.java @@ -16,6 +16,6 @@ public interface tiledbConstants { public static final int TILEDB_OK = (0); public static final int TILEDB_OOM = (-2); public static final int TILEDB_VERSION_MAJOR = 2; - public static final int TILEDB_VERSION_MINOR = 15; + public static final int TILEDB_VERSION_MINOR = 16; public static final int TILEDB_VERSION_PATCH = 0; } diff --git a/src/main/java/io/tiledb/libtiledb/tiledbJNI.java b/src/main/java/io/tiledb/libtiledb/tiledbJNI.java index eddf7057..16363b32 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledbJNI.java +++ b/src/main/java/io/tiledb/libtiledb/tiledbJNI.java @@ -830,6 +830,21 @@ public static final native long tiledb_buffer_get_data( public static final native long tiledb_buffer_set_data( long jarg1, long jarg2, long jarg3, java.math.BigInteger jarg4); + public static final native long tiledb_buffer_list_alloc(long jarg1, long jarg2); + + public static final native void tiledb_buffer_list_free(long jarg1); + + public static final native long tiledb_buffer_list_get_num_buffers( + long jarg1, long jarg2, long jarg3); + + public static final native long tiledb_buffer_list_get_buffer( + long jarg1, long jarg2, java.math.BigInteger jarg3, long jarg4); + + public static final native long tiledb_buffer_list_get_total_size( + long jarg1, long jarg2, long jarg3); + + public static final native long tiledb_buffer_list_flatten(long jarg1, long jarg2, long jarg3); + public static final native long tiledb_data_order_to_str(int jarg1, long jarg2); public static final native long tiledb_data_order_from_str(String jarg1, long jarg2); @@ -872,6 +887,38 @@ public static final native long tiledb_filter_list_get_filter_from_index( public static final native long tiledb_filter_list_get_max_chunk_size( long jarg1, long jarg2, long jarg3); + public static final native int sys_nerr_get(); + + public static final native long sys_errlist_get(); + + public static final native int tiledb_dimension_alloc( + long jarg1, String jarg2, int jarg3, long jarg4, long jarg5, long jarg6); + + public static final native void tiledb_dimension_free(long jarg1); + + public static final native int tiledb_dimension_set_filter_list( + long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_set_cell_val_num( + long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_get_filter_list( + long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_get_cell_val_num( + long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_get_name(long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_get_type(long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_get_domain(long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_get_tile_extent( + long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_dimension_dump(long jarg1, long jarg2, long jarg3); + public static final native long tiledb_group_create(long jarg1, String jarg2); public static final native long tiledb_object_type_to_str(int jarg1, long jarg2); @@ -992,21 +1039,6 @@ public static final native long tiledb_vfs_ls( public static final native void tiledb_version(long jarg1, long jarg2, long jarg3); - public static final native int tiledb_buffer_list_alloc(long jarg1, long jarg2); - - public static final native void tiledb_buffer_list_free(long jarg1); - - public static final native int tiledb_buffer_list_get_num_buffers( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_buffer_list_get_buffer( - long jarg1, long jarg2, java.math.BigInteger jarg3, long jarg4); - - public static final native int tiledb_buffer_list_get_total_size( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_buffer_list_flatten(long jarg1, long jarg2, long jarg3); - public static final native int tiledb_attribute_alloc( long jarg1, String jarg2, int jarg3, long jarg4); @@ -1069,34 +1101,6 @@ public static final native int tiledb_domain_has_dimension( public static final native int tiledb_domain_dump(long jarg1, long jarg2, long jarg3); - public static final native int tiledb_dimension_alloc( - long jarg1, String jarg2, int jarg3, long jarg4, long jarg5, long jarg6); - - public static final native void tiledb_dimension_free(long jarg1); - - public static final native int tiledb_dimension_set_filter_list( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_set_cell_val_num( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_get_filter_list( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_get_cell_val_num( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_get_name(long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_get_type(long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_get_domain(long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_get_tile_extent( - long jarg1, long jarg2, long jarg3); - - public static final native int tiledb_dimension_dump(long jarg1, long jarg2, long jarg3); - public static final native int tiledb_array_schema_alloc(long jarg1, int jarg2, long jarg3); public static final native void tiledb_array_schema_free(long jarg1); @@ -1256,6 +1260,8 @@ public static final native int tiledb_query_condition_init( public static final native int tiledb_query_condition_combine( long jarg1, long jarg2, long jarg3, int jarg4, long jarg5); + public static final native int tiledb_query_condition_negate(long jarg1, long jarg2, long jarg3); + public static final native int tiledb_subarray_alloc(long jarg1, long jarg2, long jarg3); public static final native int tiledb_subarray_set_config(long jarg1, long jarg2, long jarg3); @@ -1626,6 +1632,8 @@ public static final native long tiledb_group_consolidate_metadata( public static final native long tiledb_group_vacuum_metadata( long jarg1, String jarg2, long jarg3); + public static final native int tiledb_query_get_plan(long jarg1, long jarg2, long jarg3); + public static final native void tiledb_dimension_label_free(long jarg1); public static final native long tiledb_dimension_label_get_dimension_index( @@ -1700,6 +1708,8 @@ public static final native long tiledb_subarray_get_label_range_var_size( public static final native long tiledb_subarray_has_label_ranges( long jarg1, long jarg2, long jarg3, long jarg4); + public static final native long tiledb_log_warn(long jarg1, String jarg2); + public static final native int tiledb_array_schema_evolution_alloc(long jarg1, long jarg2); public static final native void tiledb_array_schema_evolution_free(long jarg1); diff --git a/src/main/java/io/tiledb/libtiledb/tiledb_filter_option_t.java b/src/main/java/io/tiledb/libtiledb/tiledb_filter_option_t.java index 6b0e8482..114e6edd 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb_filter_option_t.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb_filter_option_t.java @@ -17,7 +17,8 @@ public enum tiledb_filter_option_t { TILEDB_SCALE_FLOAT_OFFSET(5), TILEDB_WEBP_QUALITY(6), TILEDB_WEBP_INPUT_FORMAT(7), - TILEDB_WEBP_LOSSLESS(8); + TILEDB_WEBP_LOSSLESS(8), + TILEDB_COMPRESSION_REINTERPRET_DATATYPE(9); public final int swigValue() { return swigValue; diff --git a/src/main/java/io/tiledb/libtiledb/tiledb_filter_type_t.java b/src/main/java/io/tiledb/libtiledb/tiledb_filter_type_t.java index 2c2ff9fe..e0fe9fd5 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb_filter_type_t.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb_filter_type_t.java @@ -26,7 +26,8 @@ public enum tiledb_filter_type_t { TILEDB_FILTER_SCALE_FLOAT(15), TILEDB_FILTER_XOR(16), TILEDB_FILTER_DEPRECATED(17), - TILEDB_FILTER_WEBP(18); + TILEDB_FILTER_WEBP(18), + TILEDB_FILTER_DELTA(19); public final int swigValue() { return swigValue; diff --git a/src/main/java/io/tiledb/libtiledb/tiledb_query_status_t.java b/src/main/java/io/tiledb/libtiledb/tiledb_query_status_t.java index 9f9decfd..4beaa270 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb_query_status_t.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb_query_status_t.java @@ -13,7 +13,8 @@ public enum tiledb_query_status_t { TILEDB_COMPLETED(1), TILEDB_INPROGRESS(2), TILEDB_INCOMPLETE(3), - TILEDB_UNINITIALIZED(4); + TILEDB_UNINITIALIZED(4), + TILEDB_INITIALIZED(5); public final int swigValue() { return swigValue; diff --git a/src/test/java/io/tiledb/java/api/ArraySchemaTest.java b/src/test/java/io/tiledb/java/api/ArraySchemaTest.java index 23d4dcfb..b5414851 100644 --- a/src/test/java/io/tiledb/java/api/ArraySchemaTest.java +++ b/src/test/java/io/tiledb/java/api/ArraySchemaTest.java @@ -154,7 +154,7 @@ public void testArraySchemaSetAllowDups() throws Exception { public void testArraySchemaVersion() throws Exception { try (Context ctx = new Context(); ArraySchema schema = schemaCreate(ctx, ArrayType.TILEDB_SPARSE, layout)) { - Assert.assertEquals(18, schema.getVersion()); + Assert.assertEquals(19, schema.getVersion()); } } diff --git a/src/test/java/io/tiledb/java/api/VersionTest.java b/src/test/java/io/tiledb/java/api/VersionTest.java index 765155ef..4d27fb69 100644 --- a/src/test/java/io/tiledb/java/api/VersionTest.java +++ b/src/test/java/io/tiledb/java/api/VersionTest.java @@ -33,8 +33,8 @@ public class VersionTest { public void testVersion() { Version version = new Version(); System.out.println(version); - Assert.assertTrue(version.getMajor() >= 2); - Assert.assertTrue(version.getMinor() >= 15); - Assert.assertTrue(version.getRevision() >= 4); + Assert.assertTrue(version.getMajor() == 2); + Assert.assertTrue(version.getMinor() == 16); + Assert.assertTrue(version.getRevision() == 0); } } diff --git a/swig/tiledb.i b/swig/tiledb.i index d7b15c61..fc7347b2 100644 --- a/swig/tiledb.i +++ b/swig/tiledb.i @@ -33,6 +33,8 @@ import java.nio.ByteBuffer; typedef struct tiledb_ctx_t tiledb_ctx_t; typedef struct tiledb_filter_t tiledb_filter_t; typedef struct tiledb_config_t tiledb_config_t; +typedef struct tiledb_dimension_t tiledb_dimension_t; +typedef struct tiledb_domain_t tiledb_domain_t; %{ #include @@ -67,7 +69,7 @@ typedef struct tiledb_config_t tiledb_config_t; %ignore tiledb_array_delete_array; %ignore tiledb_query_add_point_ranges; -%include "stdint.i" +// %include "stdint.i" %include "carrays.i" %array_class(int32_t, int32_tArray); %array_class(capi_return_t, capi_return_t); @@ -139,7 +141,6 @@ typedef struct tiledb_config_t tiledb_config_t; %pointer_functions(tiledb_dimension_label_t*, tiledb_dimension_label_tpp); %pointer_functions(tiledb_string_handle_t*, tiledb_string_handle_tpp); - %native (sizeOfInt32) int sizeOfInt32(); %native (sizeOfInt64) int sizeOfInt64(); %native (sizeOfChar) int sizeOfChar(); @@ -190,7 +191,50 @@ typedef struct tiledb_config_t tiledb_config_t; %ignore _opaque_pthread_rwlockattr_t; %ignore _opaque_pthread_t; %ignore __darwin_pthread_handler_rec; - +%ignore __sbuf; +%ignore renameat; +%ignore renamex_np; +%ignore renameatx_np; +%ignore ctermid; +%ignore fileno; +%ignore pclose; +%ignore __srget; +%ignore __svfscanf; +%ignore __swbuf; +%ignore __sputc; +%ignore flockfile; +%ignore ftrylockfile; +%ignore funlockfile; +%ignore getc_unlocked; +%ignore getchar_unlocked; +%ignore putc_unlocked; +%ignore putchar_unlocked; +%ignore getw; +%ignore putw; +%ignore fseeko; +%ignore ftello; +%ignore snprintf; +%ignore vfscanf; +%ignore vscanf; +%ignore vsnprintf; +%ignore vsscanf; +%ignore dprintf; +%ignore vdprintf; +%ignore getdelim; +%ignore getline; +%ignore fmemopen; +%ignore open_memstream; +%ignore sys_nerr_get; +%ignore sys_errlist_get; +%ignore asprintf; +%ignore ctermid_r; +%ignore fgetln; +%ignore fmtcheck; +%ignore fpurge; +%ignore setbuffer; +%ignore setlinebuf; +%ignore vasprintf; +%ignore funopen; %include "tiledb_generated.h" %include "tiledb_java_extensions.h" From 4becf3e8e909a158d5dee43392ea9fa1edda9bf4 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Fri, 30 Jun 2023 13:46:42 +0300 Subject: [PATCH 2/6] Add a FragmentInfo constructor that accepts a config --- .../java/io/tiledb/java/api/FragmentInfo.java | 19 ++++++++++++++++++- .../io/tiledb/java/api/FragmentInfoTest.java | 8 +++----- .../java/io/tiledb/java/api/GroupTest.java | 2 -- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/tiledb/java/api/FragmentInfo.java b/src/main/java/io/tiledb/java/api/FragmentInfo.java index 51fee4f4..66985a44 100644 --- a/src/main/java/io/tiledb/java/api/FragmentInfo.java +++ b/src/main/java/io/tiledb/java/api/FragmentInfo.java @@ -24,6 +24,23 @@ public FragmentInfo(Context ctx, String uri) throws TileDBError { ctx.handleError(tiledb.tiledb_fragment_info_load(ctx.getCtxp(), fragmentInfop)); } + /** + * @param ctx + * @param uri + * @param config + * @throws TileDBError + */ + public FragmentInfo(Context ctx, String uri, Config config) throws TileDBError { + this.ctx = ctx; + this.uri = uri; + + this.fragmentInfopp = tiledb.new_tiledb_fragment_info_tpp(); + ctx.handleError(tiledb.tiledb_fragment_info_alloc(ctx.getCtxp(), uri, fragmentInfopp)); + fragmentInfop = tiledb.tiledb_fragment_info_tpp_value(this.fragmentInfopp); + this.setConfig(config); + ctx.handleError(tiledb.tiledb_fragment_info_load(ctx.getCtxp(), fragmentInfop)); + } + /** * Set the fragment info config. Useful for passing timestamp ranges and encryption key via the * config before loading the fragment info. @@ -31,7 +48,7 @@ public FragmentInfo(Context ctx, String uri) throws TileDBError { * @param config the TileDB config * @throws TileDBError */ - public void setConfig(Config config) throws TileDBError { + private void setConfig(Config config) throws TileDBError { try { ctx.handleError( tiledb.tiledb_fragment_info_set_config( diff --git a/src/test/java/io/tiledb/java/api/FragmentInfoTest.java b/src/test/java/io/tiledb/java/api/FragmentInfoTest.java index 1e7ea0ee..2b938b2c 100644 --- a/src/test/java/io/tiledb/java/api/FragmentInfoTest.java +++ b/src/test/java/io/tiledb/java/api/FragmentInfoTest.java @@ -678,18 +678,16 @@ public void testConfigSetGetValues() throws Exception { createSparseVarDimArray(); writeSparseVarDimArray(); - FragmentInfo info = new FragmentInfo(ctx, arrayURI); - try (Config config = new Config()) { // Set values config.set("vfs.s3.connect_timeout_ms", "5000"); config.set("vfs.s3.endpoint_override", "localhost:8888"); - info.setConfig(config); + FragmentInfo info = new FragmentInfo(ctx, arrayURI, config); // Get values - // Assert.assertEquals(config.get("vfs.s3.connect_timeout_ms"), "5000"); - // Assert.assertEquals(config.get("vfs.s3.endpoint_override"), "localhost:8888"); + Assert.assertEquals(info.getConfig().get("vfs.s3.connect_timeout_ms"), "5000"); + Assert.assertEquals(info.getConfig().get("vfs.s3.endpoint_override"), "localhost:8888"); } } diff --git a/src/test/java/io/tiledb/java/api/GroupTest.java b/src/test/java/io/tiledb/java/api/GroupTest.java index 83a6b89e..d8427abb 100644 --- a/src/test/java/io/tiledb/java/api/GroupTest.java +++ b/src/test/java/io/tiledb/java/api/GroupTest.java @@ -136,8 +136,6 @@ public void membersTest() throws Exception { // check if member is removed group.reopen(ctx, QueryType.TILEDB_READ); Assert.assertEquals(2, group.getMemberCount()); - - group.delete((short) 0); } @Test From c23651138cf990fa5eeb18e9e55746242b268d68 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Fri, 30 Jun 2023 14:08:03 +0300 Subject: [PATCH 3/6] add support for negation in Query Conditions --- .../io/tiledb/java/api/QueryCondition.java | 34 +++++++++++++++++-- .../tiledb/java/api/QueryConditionTest.java | 27 ++++++++++++--- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/tiledb/java/api/QueryCondition.java b/src/main/java/io/tiledb/java/api/QueryCondition.java index ffd2b97f..27740ae5 100644 --- a/src/main/java/io/tiledb/java/api/QueryCondition.java +++ b/src/main/java/io/tiledb/java/api/QueryCondition.java @@ -161,7 +161,15 @@ public void close() { } } - public QueryCondition combine(QueryCondition con2, tiledb_query_condition_combination_op_t OP) + /** + * Combines this instance with another instance to form a multi-clause condition object. + * + * @param rhs The right-hand-side query condition object. + * @param OP The logical combination operator that combines this instance with `rhs` + * @return The result Query Condition + * @throws TileDBError + */ + public QueryCondition combine(QueryCondition rhs, tiledb_query_condition_combination_op_t OP) throws TileDBError { SWIGTYPE_p_p_tiledb_query_condition_t combinedCondition; try { @@ -169,11 +177,33 @@ public QueryCondition combine(QueryCondition con2, tiledb_query_condition_combin ctx.handleError(tiledb.tiledb_query_condition_alloc(ctx.getCtxp(), conditionpp)); ctx.handleError( tiledb.tiledb_query_condition_combine( - ctx.getCtxp(), conditionp, con2.getConditionp(), OP, combinedCondition)); + ctx.getCtxp(), conditionp, rhs.getConditionp(), OP, combinedCondition)); } catch (TileDBError err) { tiledb.delete_tiledb_query_condition_tpp(conditionpp); throw err; } return new QueryCondition(ctx, combinedCondition); } + + /** + * Create a query condition representing a negation of the input query condition. Currently, this + * is performed by applying De Morgan's theorem recursively to the query condition's internal + * representation. + * + * @return The negated Query Condition + * @throws TileDBError + */ + public QueryCondition negate() throws TileDBError { + SWIGTYPE_p_p_tiledb_query_condition_t negatedCondition; + try { + negatedCondition = tiledb.new_tiledb_query_condition_tpp(); + ctx.handleError(tiledb.tiledb_query_condition_alloc(ctx.getCtxp(), conditionpp)); + ctx.handleError( + tiledb.tiledb_query_condition_negate(ctx.getCtxp(), conditionp, negatedCondition)); + } catch (TileDBError err) { + tiledb.delete_tiledb_query_condition_tpp(conditionpp); + throw err; + } + return new QueryCondition(ctx, negatedCondition); + } } diff --git a/src/test/java/io/tiledb/java/api/QueryConditionTest.java b/src/test/java/io/tiledb/java/api/QueryConditionTest.java index 55d20e65..d18e7e60 100644 --- a/src/test/java/io/tiledb/java/api/QueryConditionTest.java +++ b/src/test/java/io/tiledb/java/api/QueryConditionTest.java @@ -32,8 +32,7 @@ import static io.tiledb.java.api.QueryType.*; import static io.tiledb.libtiledb.tiledb_query_condition_combination_op_t.TILEDB_AND; import static io.tiledb.libtiledb.tiledb_query_condition_combination_op_t.TILEDB_OR; -import static io.tiledb.libtiledb.tiledb_query_condition_op_t.TILEDB_EQ; -import static io.tiledb.libtiledb.tiledb_query_condition_op_t.TILEDB_GT; +import static io.tiledb.libtiledb.tiledb_query_condition_op_t.*; import java.util.HashMap; import org.junit.Assert; @@ -194,8 +193,6 @@ private void arrayRead() throws Exception { query.submit(); // Print cell values (assumes all getAttributes are read) - HashMap> result_el = query.resultBufferElements(); - int[] a1_buff = (int[]) query.getBuffer("a1"); float[] a2_buff = (float[]) query.getBuffer("a2"); // for (int i = 0; i < a1_buff.length; i++) { @@ -230,6 +227,28 @@ public void testCondition() throws Exception { arrayRead(); } + @Test + public void testNegation() throws TileDBError { + // create array + arrayCreateSparse(); + arrayWriteSparse(); + + // check if data was deleted + Array array = new Array(ctx, arrayURISparse); + + Query query = new Query(array, TILEDB_READ); + query.setDataBuffer("a1", new NativeArray(ctx, 40, Integer.class)); + QueryCondition con = new QueryCondition(ctx, "a1", 3, Integer.class, TILEDB_GT); + query.setCondition(con.negate()); + query.submit(); + + int[] a1_buff = (int[]) query.getBuffer("a1"); + Assert.assertArrayEquals(new int[] {1, 2, 3}, a1_buff); + array.close(); + query.close(); + con.close(); + } + @Test public void testDataDeletion() throws TileDBError { // create array From 4ff08255c694f17cc491b015b587809d2e5d7645 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Mon, 3 Jul 2023 13:59:08 +0300 Subject: [PATCH 4/6] add support for the Query Plan API --- .../java/io/tiledb/java/api/FragmentInfo.java | 4 ++-- src/main/java/io/tiledb/java/api/Query.java | 16 ++++++++++++++++ .../io/tiledb/java/api/FragmentInfoTest.java | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/tiledb/java/api/FragmentInfo.java b/src/main/java/io/tiledb/java/api/FragmentInfo.java index 66985a44..313e01eb 100644 --- a/src/main/java/io/tiledb/java/api/FragmentInfo.java +++ b/src/main/java/io/tiledb/java/api/FragmentInfo.java @@ -686,12 +686,12 @@ public String getFragmentName(long fragmentID) throws TileDBError { * @return The fragment name. * @throws TileDBError */ - public TileDBString getFragmentNameV2(long fragmentID) throws TileDBError { + public String getFragmentNameV2(long fragmentID) throws TileDBError { SWIGTYPE_p_p_tiledb_string_handle_t name = tiledb.new_tiledb_string_handle_tpp(); ctx.handleError( tiledb.tiledb_fragment_info_get_fragment_name_v2( ctx.getCtxp(), fragmentInfop, fragmentID, name)); - return new TileDBString(ctx, name); + return new TileDBString(ctx, name).getView().getFirst(); } } diff --git a/src/main/java/io/tiledb/java/api/Query.java b/src/main/java/io/tiledb/java/api/Query.java index 2ce51d97..217d4eca 100644 --- a/src/main/java/io/tiledb/java/api/Query.java +++ b/src/main/java/io/tiledb/java/api/Query.java @@ -1337,6 +1337,22 @@ public long[] getOffsetArray(String bufferName) throws TileDBError { return getOffsetsBufferNIO(bufferName); } + /** + * Fetches a query plan string representation given a context and an unsubmitted yet fully formed + * query object. The returned query plan is represented as valid JSON, but the API is still + * experimental, there is no JSON schema describing it and the content of the returned query plan + * will most likely change. + * + * @return The plan. + * @exception TileDBError A TileDB exception + */ + public String getPlan() throws TileDBError { + SWIGTYPE_p_p_tiledb_string_handle_t plan = tiledb.new_tiledb_string_handle_tpp(); + + ctx.handleError(tiledb.tiledb_query_get_plan(ctx.getCtxp(), queryp, plan)); + return new TileDBString(ctx, plan).getView().getFirst(); + } + /** * Returns the validity buffer of a nullable attribute * diff --git a/src/test/java/io/tiledb/java/api/FragmentInfoTest.java b/src/test/java/io/tiledb/java/api/FragmentInfoTest.java index 2b938b2c..e0db479c 100644 --- a/src/test/java/io/tiledb/java/api/FragmentInfoTest.java +++ b/src/test/java/io/tiledb/java/api/FragmentInfoTest.java @@ -80,7 +80,7 @@ public void testArraySchemaName() throws Exception { long numFragments = info.getFragmentNum(); for (int i = 0; i < numFragments; ++i) { Assert.assertNotNull(info.getArraySchemaName(i)); - Assert.assertNotNull(info.getFragmentNameV2(i).getView().getFirst()); + Assert.assertNotNull(info.getFragmentNameV2(i)); } Assert.assertEquals(testFragmentCount, numFragments); From 1de8c6e5e3adc0c82aa588f819ea29bb6f4c6251 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Mon, 3 Jul 2023 14:18:14 +0300 Subject: [PATCH 5/6] add support for Delta Filter --- gradle.properties | 2 +- .../java/io/tiledb/java/api/DeltaFilter.java | 46 +++++++++++++++++++ .../java/io/tiledb/java/api/FilterList.java | 2 + .../java/io/tiledb/java/api/FilterTest.java | 13 ++++++ .../java/io/tiledb/java/api/QueryTest.java | 6 ++- 5 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 src/main/java/io/tiledb/java/api/DeltaFilter.java diff --git a/gradle.properties b/gradle.properties index 11f414ae..21d975f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,6 @@ TILEDB_S3=ON TILEDB_AZURE=OFF TILEDB_HDFS=OFF TILEDB_SERIALIZATION=OFF -FORCE_BUILD_TILEDB=OFF +FORCE_BUILD_TILEDB=ON DOWNLOAD_TILEDB_PREBUILT=ON TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK=ON diff --git a/src/main/java/io/tiledb/java/api/DeltaFilter.java b/src/main/java/io/tiledb/java/api/DeltaFilter.java new file mode 100644 index 00000000..34227a6e --- /dev/null +++ b/src/main/java/io/tiledb/java/api/DeltaFilter.java @@ -0,0 +1,46 @@ +package io.tiledb.java.api; + +import io.tiledb.libtiledb.SWIGTYPE_p_p_tiledb_filter_t; +import io.tiledb.libtiledb.tiledb; +import io.tiledb.libtiledb.tiledb_datatype_t; +import io.tiledb.libtiledb.tiledb_filter_option_t; +import io.tiledb.libtiledb.tiledb_filter_type_t; + +public class DeltaFilter extends CompressionFilter { + + public DeltaFilter(Context ctx, int level, tiledb_datatype_t type) throws TileDBError { + super(ctx, tiledb_filter_type_t.TILEDB_FILTER_DELTA, level); + + try (NativeArray reint = new NativeArray(ctx, new int[] {type.swigValue()}, Integer.class); ) { + + ctx.handleError( + tiledb.tiledb_filter_set_option( + ctx.getCtxp(), + getFilterp(), + tiledb_filter_option_t.TILEDB_COMPRESSION_REINTERPRET_DATATYPE, + reint.toVoidPointer())); + + } catch (TileDBError e) { + throw e; + } + } + + public tiledb_datatype_t getCompressionReinterpretDatatype() throws TileDBError { + Context ctx = getCtx(); + int datatype; + try (NativeArray datatypetArray = new NativeArray(ctx, 1, Integer.class)) { + ctx.handleError( + tiledb.tiledb_filter_get_option( + ctx.getCtxp(), + getFilterp(), + tiledb_filter_option_t.TILEDB_COMPRESSION_REINTERPRET_DATATYPE, + datatypetArray.toVoidPointer())); + datatype = (int) datatypetArray.getItem(0); + } + return tiledb_datatype_t.swigToEnum(datatype); + } + + protected DeltaFilter(Context ctx, SWIGTYPE_p_p_tiledb_filter_t filterpp) { + super(ctx, filterpp); + } +} diff --git a/src/main/java/io/tiledb/java/api/FilterList.java b/src/main/java/io/tiledb/java/api/FilterList.java index b5f77a68..58689b70 100644 --- a/src/main/java/io/tiledb/java/api/FilterList.java +++ b/src/main/java/io/tiledb/java/api/FilterList.java @@ -96,6 +96,8 @@ public Filter getFilter(long idx) throws TileDBError { return new XORFilter(this.ctx, _filterpp); case TILEDB_FILTER_WEBP: return new WebPFilter(this.ctx, _filterpp); + case TILEDB_FILTER_DELTA: + return new DeltaFilter(this.ctx, _filterpp); default: { tiledb.delete_tiledb_filter_tpp(_filterpp); diff --git a/src/test/java/io/tiledb/java/api/FilterTest.java b/src/test/java/io/tiledb/java/api/FilterTest.java index 5f5c9e89..7b7a54ce 100644 --- a/src/test/java/io/tiledb/java/api/FilterTest.java +++ b/src/test/java/io/tiledb/java/api/FilterTest.java @@ -6,6 +6,7 @@ import static io.tiledb.java.api.QueryType.TILEDB_READ; import static io.tiledb.java.api.QueryType.TILEDB_WRITE; +import io.tiledb.libtiledb.tiledb_datatype_t; import java.nio.file.Files; import java.nio.file.Paths; import org.junit.After; @@ -129,6 +130,18 @@ public void testDoubleDeltaFilter() throws Exception { } } + @Test + public void testDeltaFilter() throws Exception { + // DD accepts compression level, but it is an ignored parameter + try (Context ctx = new Context()) { + try (DeltaFilter filter = new DeltaFilter(ctx, 5, tiledb_datatype_t.TILEDB_INT32)) { + Assert.assertEquals(filter.getLevel(), 5); + Assert.assertEquals( + tiledb_datatype_t.TILEDB_INT32, filter.getCompressionReinterpretDatatype()); + } + } + } + @Test public void testBitShuffle() throws Exception { try (Context ctx = new Context(); diff --git a/src/test/java/io/tiledb/java/api/QueryTest.java b/src/test/java/io/tiledb/java/api/QueryTest.java index cc03da29..a5619930 100644 --- a/src/test/java/io/tiledb/java/api/QueryTest.java +++ b/src/test/java/io/tiledb/java/api/QueryTest.java @@ -8,6 +8,7 @@ import static io.tiledb.java.api.QueryType.TILEDB_READ; import static io.tiledb.java.api.QueryType.TILEDB_WRITE; +import io.tiledb.libtiledb.tiledb_datatype_t; import java.math.BigInteger; import java.nio.*; import java.nio.charset.StandardCharsets; @@ -61,7 +62,10 @@ public void arrayCreate() throws Exception { new FilterList(ctx) .addFilter(new CheckSumMD5Filter(ctx)) .addFilter(new BitShuffleFilter(ctx))); - a2.setFilterList(new FilterList(ctx).addFilter(new CheckSumSHA256Filter(ctx))); + a2.setFilterList( + new FilterList(ctx) + .addFilter(new CheckSumSHA256Filter(ctx)) + .addFilter(new DeltaFilter(ctx, 1, tiledb_datatype_t.TILEDB_INT32))); a3.setFilterList(new FilterList(ctx).addFilter(new XORFilter(ctx))); a2.setCellValNum(2); From 309e7bda098de0f5cc000c3398a44831579a2052 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Tue, 15 Aug 2023 11:49:22 +0300 Subject: [PATCH 6/6] update to TileDB-2.16.3 --- CMakeLists.txt | 7 ++++++ README.md | 1 + cmake/Modules/FindTileDB_EP.cmake | 12 +++++----- gradle.properties | 4 ++-- src/main/c/generated/tiledb_wrap.cxx | 24 ------------------- .../java/io/tiledb/java/api/FragmentInfo.java | 6 ++--- src/main/java/io/tiledb/libtiledb/tiledb.java | 9 ------- .../java/io/tiledb/libtiledb/tiledbJNI.java | 4 ---- .../java/io/tiledb/java/api/VersionTest.java | 2 +- 9 files changed, 20 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2f854f1..3d2d332e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,13 @@ if (WIN32) PRIVATE ${PCRE2_POSIX} ${PCRE2_8} + WebServices + Winhttp + Wininet + Userenv + Version + Secur32 + Ncrypt ) endif() diff --git a/README.md b/README.md index 5db30aa4..4a396047 100644 --- a/README.md +++ b/README.md @@ -60,4 +60,5 @@ The below table references which versions of TileDB-Java are compatible with whi | 0.15.X | 2.13.X | | 0.16.X | 2.14.X | | 0.17.X | 2.15.X | +| 0.18.X | 2.16.X | diff --git a/cmake/Modules/FindTileDB_EP.cmake b/cmake/Modules/FindTileDB_EP.cmake index bd48c659..9750339a 100644 --- a/cmake/Modules/FindTileDB_EP.cmake +++ b/cmake/Modules/FindTileDB_EP.cmake @@ -48,14 +48,14 @@ if (NOT TILEDB_FOUND) # Try to download prebuilt artifacts unless the user specifies to build from source if(DOWNLOAD_TILEDB_PREBUILT) if (WIN32) # Windows - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.0-rc0/tiledb-windows-x86_64-2.16.0-rc0-d4a37a6.zip") - SET(DOWNLOAD_SHA1 "5237ce7dcfa07d629e00a32c41f366e4a52a11f2") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.3/tiledb-windows-x86_64-2.16.3-194b5ae.zip") + SET(DOWNLOAD_SHA1 "8e986b6143ef9509201c7f2b3c0a7a53ff41095a") elseif(APPLE) # macOS - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.0-rc0/tiledb-macos-x86_64-2.16.0-rc0-d4a37a6.tar.gz") - SET(DOWNLOAD_SHA1 "619741d8a8936e0fb6bc19ace9c111c29dfe226a") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.3/tiledb-macos-x86_64-2.16.3-194b5ae.tar.gz") + SET(DOWNLOAD_SHA1 "b4d35306771d1c30b49bf2a98651e8e24c91037e") else() # Linux - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.0-rc0/tiledb-linux-x86_64-2.16.0-rc0-d4a37a6.tar.gz") - SET(DOWNLOAD_SHA1 "c8ddba2c0f7bfecbb8df62d67ba1b7d98b79d000") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.3/tiledb-linux-x86_64-2.16.3-194b5ae.tar.gz") + SET(DOWNLOAD_SHA1 "6ccafbee52137478d0b8146e71a11323755c9ed5") endif() ExternalProject_Add(ep_tiledb diff --git a/gradle.properties b/gradle.properties index 21d975f8..baf9a1c2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ TILEDB_GIT_REPOSITORY=https://github.com/TileDB-Inc/TileDB -TILEDB_GIT_TAG=2.16.0-rc0 +TILEDB_GIT_TAG=2.16.3 TILEDB_VERBOSE=ON TILEDB_S3=ON TILEDB_AZURE=OFF TILEDB_HDFS=OFF TILEDB_SERIALIZATION=OFF -FORCE_BUILD_TILEDB=ON +FORCE_BUILD_TILEDB=OFF DOWNLOAD_TILEDB_PREBUILT=ON TILEDB_SKIP_S3AWSSDK_DIR_LENGTH_CHECK=ON diff --git a/src/main/c/generated/tiledb_wrap.cxx b/src/main/c/generated/tiledb_wrap.cxx index 1b09330d..c46dbf21 100644 --- a/src/main/c/generated/tiledb_wrap.cxx +++ b/src/main/c/generated/tiledb_wrap.cxx @@ -6770,30 +6770,6 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1filter_1list } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_sys_1nerr_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(int)sys_nerr; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_sys_1errlist_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - char **result = 0 ; - - (void)jenv; - (void)jcls; - result = (char **)(char **)sys_errlist; - *(char ***)&jresult = result; - return jresult; -} - - SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3, jlong jarg4, jlong jarg5, jlong jarg6) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; diff --git a/src/main/java/io/tiledb/java/api/FragmentInfo.java b/src/main/java/io/tiledb/java/api/FragmentInfo.java index 313e01eb..782f36a6 100644 --- a/src/main/java/io/tiledb/java/api/FragmentInfo.java +++ b/src/main/java/io/tiledb/java/api/FragmentInfo.java @@ -48,7 +48,7 @@ public FragmentInfo(Context ctx, String uri, Config config) throws TileDBError { * @param config the TileDB config * @throws TileDBError */ - private void setConfig(Config config) throws TileDBError { + public void setConfig(Config config) throws TileDBError { try { ctx.handleError( tiledb.tiledb_fragment_info_set_config( @@ -686,12 +686,12 @@ public String getFragmentName(long fragmentID) throws TileDBError { * @return The fragment name. * @throws TileDBError */ - public String getFragmentNameV2(long fragmentID) throws TileDBError { + public TileDBString getFragmentNameV2(long fragmentID) throws TileDBError { SWIGTYPE_p_p_tiledb_string_handle_t name = tiledb.new_tiledb_string_handle_tpp(); ctx.handleError( tiledb.tiledb_fragment_info_get_fragment_name_v2( ctx.getCtxp(), fragmentInfop, fragmentID, name)); - return new TileDBString(ctx, name).getView().getFirst(); + return new TileDBString(ctx, name); } } diff --git a/src/main/java/io/tiledb/libtiledb/tiledb.java b/src/main/java/io/tiledb/libtiledb/tiledb.java index 70a2ede0..f859d5d5 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb.java @@ -1972,15 +1972,6 @@ public static capi_return_t tiledb_filter_list_get_max_chunk_size( true); } - public static int getSys_nerr() { - return tiledbJNI.sys_nerr_get(); - } - - public static SWIGTYPE_p_p_char getSys_errlist() { - long cPtr = tiledbJNI.sys_errlist_get(); - return (cPtr == 0) ? null : new SWIGTYPE_p_p_char(cPtr, false); - } - public static int tiledb_dimension_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, String name, diff --git a/src/main/java/io/tiledb/libtiledb/tiledbJNI.java b/src/main/java/io/tiledb/libtiledb/tiledbJNI.java index 16363b32..1c490d2d 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledbJNI.java +++ b/src/main/java/io/tiledb/libtiledb/tiledbJNI.java @@ -887,10 +887,6 @@ public static final native long tiledb_filter_list_get_filter_from_index( public static final native long tiledb_filter_list_get_max_chunk_size( long jarg1, long jarg2, long jarg3); - public static final native int sys_nerr_get(); - - public static final native long sys_errlist_get(); - public static final native int tiledb_dimension_alloc( long jarg1, String jarg2, int jarg3, long jarg4, long jarg5, long jarg6); diff --git a/src/test/java/io/tiledb/java/api/VersionTest.java b/src/test/java/io/tiledb/java/api/VersionTest.java index 4d27fb69..17892b17 100644 --- a/src/test/java/io/tiledb/java/api/VersionTest.java +++ b/src/test/java/io/tiledb/java/api/VersionTest.java @@ -35,6 +35,6 @@ public void testVersion() { System.out.println(version); Assert.assertTrue(version.getMajor() == 2); Assert.assertTrue(version.getMinor() == 16); - Assert.assertTrue(version.getRevision() == 0); + Assert.assertTrue(version.getRevision() == 3); } }