From 71bdb816fe58827cb2f049eb0a896192e4bcf4f1 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Mon, 14 Mar 2022 20:15:40 +0200 Subject: [PATCH 1/2] Update to TileDB 2.7 and support all new features and changes --- README.md | 67 +- cmake/Modules/FindTileDB_EP.cmake | 12 +- gradle.properties | 2 +- src/main/c/generated/tiledb_wrap.cxx | 1257 +++++++++++++++-- .../java/io/tiledb/java/api/ArraySchema.java | 42 +- .../tiledb/java/api/ArraySchemaEvolution.java | 18 + .../java/io/tiledb/java/api/FragmentInfo.java | 17 + src/main/java/io/tiledb/java/api/Query.java | 31 +- .../io/tiledb/java/api/QueryCondition.java | 2 +- .../java/io/tiledb/java/api/SubArray.java | 554 ++++++++ .../SWIGTYPE_p_p_tiledb_subarray_t.java | 26 + .../SWIGTYPE_p_tiledb_subarray_t.java | 25 + src/main/java/io/tiledb/libtiledb/tiledb.java | 360 +++++ .../io/tiledb/libtiledb/tiledbConstants.java | 3 +- .../java/io/tiledb/libtiledb/tiledbJNI.java | 115 ++ .../tiledb/libtiledb/tiledb_datatype_t.java | 3 +- .../tiledb_query_status_details_reason_t.java | 54 + .../tiledb_query_status_details_t.java | 52 + .../io/tiledb/java/api/ArraySchemaTest.java | 8 + .../io/tiledb/java/api/FragmentInfoTest.java | 20 + .../tiledb/java/api/MultiRangeQueryTest.java | 46 +- .../tiledb/java/api/QueryConditionTest.java | 32 +- swig/tiledb.i | 1 + 23 files changed, 2564 insertions(+), 183 deletions(-) create mode 100644 src/main/java/io/tiledb/java/api/SubArray.java create mode 100644 src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_subarray_t.java create mode 100644 src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_subarray_t.java create mode 100644 src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_reason_t.java create mode 100644 src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_t.java diff --git a/README.md b/README.md index 6447b0fc..648f4538 100644 --- a/README.md +++ b/README.md @@ -18,37 +18,38 @@ For misc development details see [Development Notes](https://github.com/TileDB-I The below table references which versions of TileDB-Java are compatible with which versions of the TileDB core library. -|TileDB-Java Version|TileDB Version| -|-----------------|--------------| -| 0.1.5 | <= 1.5.1 | -| 0.1.6 | 1.6.0 | -| 0.1.7 | 1.6.2 | -| 0.1.8 | 1.6.2 | -| 0.1.9 | 1.6.2 | -| 0.2.0 | 1.7.0 | -| 0.2.1 | 1.7.2 | -| 0.2.2 | 1.7.2 | -| 0.2.3 | 1.7.3 | -| 0.2.4 | 1.7.7 | -| 0.2.5 | 2.0.0 | -| 0.2.6 | 2.0.1 | -| 0.2.7 | 2.0.3 | -| 0.2.8 | 2.0.5 | -| 0.3.0 | 2.0.5 | -| 0.3.1 | 2.0.7 | -| 0.3.2 | 2.0.8 | -| 0.3.3 | 2.0.8 | -| 0.3.4 | 2.1.1 | -| 0.3.5 | 2.1.2 | -| 0.3.6 | 2.1.2 | -| 0.3.7 | 2.2.2 | -| 0.4.0 | 2.2.5 | -| 0.4.1 | 2.2.5 | -| 0.4.2 | 2.2.5 | -| 0.4.3 | 2.2.5 | -| 0.4.4 | 2.2.5 | -| 0.5.X | 2.3.X | -| 0.6.X | 2.4.X | -| 0.7.X | 2.5.X | -| 0.8.X | 2.6.X | +| TileDB-Java Version | TileDB Version | +|---------------------|----------------| +| 0.1.5 | <= 1.5.1 | +| 0.1.6 | 1.6.0 | +| 0.1.7 | 1.6.2 | +| 0.1.8 | 1.6.2 | +| 0.1.9 | 1.6.2 | +| 0.2.0 | 1.7.0 | +| 0.2.1 | 1.7.2 | +| 0.2.2 | 1.7.2 | +| 0.2.3 | 1.7.3 | +| 0.2.4 | 1.7.7 | +| 0.2.5 | 2.0.0 | +| 0.2.6 | 2.0.1 | +| 0.2.7 | 2.0.3 | +| 0.2.8 | 2.0.5 | +| 0.3.0 | 2.0.5 | +| 0.3.1 | 2.0.7 | +| 0.3.2 | 2.0.8 | +| 0.3.3 | 2.0.8 | +| 0.3.4 | 2.1.1 | +| 0.3.5 | 2.1.2 | +| 0.3.6 | 2.1.2 | +| 0.3.7 | 2.2.2 | +| 0.4.0 | 2.2.5 | +| 0.4.1 | 2.2.5 | +| 0.4.2 | 2.2.5 | +| 0.4.3 | 2.2.5 | +| 0.4.4 | 2.2.5 | +| 0.5.X | 2.3.X | +| 0.6.X | 2.4.X | +| 0.7.X | 2.5.X | +| 0.8.X | 2.6.X | +| 0.9.X | 2.7.X | diff --git a/cmake/Modules/FindTileDB_EP.cmake b/cmake/Modules/FindTileDB_EP.cmake index 2dc9cfd9..c8c4abbc 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.6.3/tiledb-windows-x86_64-2.6.3-534ca7c.zip") - SET(DOWNLOAD_SHA1 "bdfb3841b3c85d4fb1ee64f74d2d54eb39e1a3d5") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.0/tiledb-windows-x86_64-2.7.0-4f39c6c.zip") + SET(DOWNLOAD_SHA1 "b441e0684a73dbdd3b55d2448e4b32a03bd4750f") elseif(APPLE) # macOS - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.3/tiledb-macos-x86_64-2.6.3-534ca7c.tar.gz") - SET(DOWNLOAD_SHA1 "8df5477b443be6f4442be4f203052ad9740dfabc") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.0/tiledb-macos-x86_64-2.7.0-4f39c6c.tar.gz") + SET(DOWNLOAD_SHA1 "f5b7a6ac44e0aed2d2689b9b5f7d51c506e9a9e1") else() # Linux - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.6.3/tiledb-linux-x86_64-2.6.3-534ca7c.tar.gz") - SET(DOWNLOAD_SHA1 "0ce53f609879b1d906bde96785689029212cd2f4") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.0/tiledb-linux-x86_64-2.7.0-4f39c6c.tar.gz") + SET(DOWNLOAD_SHA1 "9fa2c0607ca479fbb9f506e466cd60ad0189a6f6") endif() ExternalProject_Add(ep_tiledb diff --git a/gradle.properties b/gradle.properties index 8f341438..04028803 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ TILEDB_GIT_REPOSITORY=https://github.com/TileDB-Inc/TileDB -TILEDB_GIT_TAG=2.6.3 +TILEDB_GIT_TAG=2.7.0 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 1a533d56..131060c1 100644 --- a/src/main/c/generated/tiledb_wrap.cxx +++ b/src/main/c/generated/tiledb_wrap.cxx @@ -927,6 +927,27 @@ static tiledb_array_t* tiledb_array_tpp_value(tiledb_array_t* *obj) { } +static tiledb_subarray_t* *new_tiledb_subarray_tpp() { + return new tiledb_subarray_t*(); +} + +static tiledb_subarray_t* *copy_tiledb_subarray_tpp(tiledb_subarray_t* value) { + return new tiledb_subarray_t*(value); +} + +static void delete_tiledb_subarray_tpp(tiledb_subarray_t* *obj) { + if (obj) delete obj; +} + +static void tiledb_subarray_tpp_assign(tiledb_subarray_t* *obj, tiledb_subarray_t* value) { + *obj = value; +} + +static tiledb_subarray_t* tiledb_subarray_tpp_value(tiledb_subarray_t* *obj) { + return *obj; +} + + static tiledb_config_t* *new_tiledb_config_tpp() { return new tiledb_config_t*(); } @@ -3679,6 +3700,68 @@ SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1tpp_1 } +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_new_1tiledb_1subarray_1tpp(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + tiledb_subarray_t **result = 0 ; + + (void)jenv; + (void)jcls; + result = (tiledb_subarray_t **)new_tiledb_subarray_tpp(); + *(tiledb_subarray_t ***)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_copy_1tiledb_1subarray_1tpp(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong jresult = 0 ; + tiledb_subarray_t *arg1 = (tiledb_subarray_t *) 0 ; + tiledb_subarray_t **result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_subarray_t **)&jarg1; + result = (tiledb_subarray_t **)copy_tiledb_subarray_tpp(arg1); + *(tiledb_subarray_t ***)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_delete_1tiledb_1subarray_1tpp(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tiledb_subarray_t **arg1 = (tiledb_subarray_t **) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_subarray_t ***)&jarg1; + delete_tiledb_subarray_tpp(arg1); +} + + +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1tpp_1assign(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) { + tiledb_subarray_t **arg1 = (tiledb_subarray_t **) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_subarray_t ***)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + tiledb_subarray_tpp_assign(arg1,arg2); +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1tpp_1value(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong jresult = 0 ; + tiledb_subarray_t **arg1 = (tiledb_subarray_t **) 0 ; + tiledb_subarray_t *result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_subarray_t ***)&jarg1; + result = (tiledb_subarray_t *)tiledb_subarray_tpp_value(arg1); + *(tiledb_subarray_t **)&jresult = result; + return jresult; +} + + SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_new_1tiledb_1config_1tpp(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; tiledb_config_t **result = 0 ; @@ -6973,6 +7056,24 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema_1get_1version(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_schema_t *arg2 = (tiledb_array_schema_t *) 0 ; + uint32_t *arg3 = (uint32_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_schema_t **)&jarg2; + arg3 = *(uint32_t **)&jarg3; + result = (int32_t)tiledb_array_schema_get_version(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema_1set_1domain(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -7534,6 +7635,24 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1set_1s } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1set_1subarray_1t(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_subarray_t *arg3 = (tiledb_subarray_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_query_t **)&jarg2; + arg3 = *(tiledb_subarray_t **)&jarg3; + result = (int32_t)tiledb_query_set_subarray_t(arg1,arg2,(tiledb_subarray_t const *)arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1set_1buffer(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jlong jarg4, jlong jarg5) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -8918,6 +9037,24 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1get_1f } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1get_1subarray_1t(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_subarray_t **arg3 = (tiledb_subarray_t **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_query_t **)&jarg2; + arg3 = *(tiledb_subarray_t ***)&jarg3; + result = (int32_t)tiledb_query_get_subarray_t(arg1,(tiledb_query_t const *)arg2,arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1condition_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -9020,182 +9157,158 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1condit } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jlong jarg3) { +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 ; - char *arg2 = (char *) 0 ; - tiledb_array_t **arg3 = (tiledb_array_t **) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + tiledb_subarray_t **arg3 = (tiledb_subarray_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_array_t ***)&jarg3; - result = (int32_t)tiledb_array_alloc(arg1,(char const *)arg2,arg3); + arg2 = *(tiledb_array_t **)&jarg2; + arg3 = *(tiledb_subarray_t ***)&jarg3; + result = (int32_t)tiledb_subarray_alloc(arg1,(tiledb_array_t const *)arg2,arg3); jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1set_1open_1timestamp_1start(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3) { +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1set_1config(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - uint64_t arg3 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + tiledb_config_t *arg3 = (tiledb_config_t *) 0 ; int32_t result; (void)jenv; (void)jcls; arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_array_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); - } - result = (int32_t)tiledb_array_set_open_timestamp_start(arg1,arg2,arg3); + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = *(tiledb_config_t **)&jarg3; + result = (int32_t)tiledb_subarray_set_config(arg1,arg2,arg3); jresult = (jint)result; return jresult; } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1set_1open_1timestamp_1end(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3) { +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1free(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tiledb_subarray_t **arg1 = (tiledb_subarray_t **) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_subarray_t ***)&jarg1; + tiledb_subarray_free(arg1); +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1set_1coalesce_1ranges(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - uint64_t arg3 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + int arg3 ; int32_t result; (void)jenv; (void)jcls; arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_array_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); - } - result = (int32_t)tiledb_array_set_open_timestamp_end(arg1,arg2,arg3); + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (int)jarg3; + result = (int32_t)tiledb_subarray_set_coalesce_ranges(arg1,arg2,arg3); jresult = (jint)result; return jresult; } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1get_1open_1timestamp_1start(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1set_1subarray(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - uint64_t *arg3 = (uint64_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + void *arg3 = (void *) 0 ; int32_t result; (void)jenv; (void)jcls; arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_array_t **)&jarg2; - arg3 = *(uint64_t **)&jarg3; - result = (int32_t)tiledb_array_get_open_timestamp_start(arg1,arg2,arg3); + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = *(void **)&jarg3; + result = (int32_t)tiledb_subarray_set_subarray(arg1,arg2,(void const *)arg3); jresult = (jint)result; return jresult; } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1get_1open_1timestamp_1end(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1add_1range(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4, jlong jarg5, jlong jarg6) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - uint64_t *arg3 = (uint64_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + void *arg4 = (void *) 0 ; + void *arg5 = (void *) 0 ; + void *arg6 = (void *) 0 ; int32_t result; (void)jenv; (void)jcls; arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_array_t **)&jarg2; - arg3 = *(uint64_t **)&jarg3; - result = (int32_t)tiledb_array_get_open_timestamp_end(arg1,arg2,arg3); + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + arg4 = *(void **)&jarg4; + arg5 = *(void **)&jarg5; + arg6 = *(void **)&jarg6; + result = (int32_t)tiledb_subarray_add_range(arg1,arg2,arg3,(void const *)arg4,(void const *)arg5,(void const *)arg6); jresult = (jint)result; return jresult; } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) { +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1add_1range_1by_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jlong jarg4, jlong jarg5, jlong jarg6) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - tiledb_query_type_t arg3 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + char *arg3 = (char *) 0 ; + void *arg4 = (void *) 0 ; + void *arg5 = (void *) 0 ; + void *arg6 = (void *) 0 ; int32_t result; (void)jenv; (void)jcls; arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_array_t **)&jarg2; - arg3 = (tiledb_query_type_t)jarg3; - result = (int32_t)tiledb_array_open(arg1,arg2,arg3); + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + arg4 = *(void **)&jarg4; + arg5 = *(void **)&jarg5; + arg6 = *(void **)&jarg6; + result = (int32_t)tiledb_subarray_add_range_by_name(arg1,arg2,(char const *)arg3,(void const *)arg4,(void const *)arg5,(void const *)arg6); jresult = (jint)result; + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); return jresult; } -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open_1at(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3, jobject jarg4) { +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1add_1range_1var(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg5, jlong jarg6, jobject jarg7) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - tiledb_query_type_t arg3 ; - uint64_t arg4 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + void *arg4 = (void *) 0 ; + uint64_t arg5 ; + void *arg6 = (void *) 0 ; + uint64_t arg7 ; int32_t result; (void)jenv; (void)jcls; arg1 = *(tiledb_ctx_t **)&jarg1; - arg2 = *(tiledb_array_t **)&jarg2; - arg3 = (tiledb_query_type_t)jarg3; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + arg4 = *(void **)&jarg4; { jclass clazz; jmethodID mid; @@ -9204,35 +9317,709 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open_1 jsize sz; int i; - if (!jarg4) { + if (!jarg5) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); return 0; } - clazz = jenv->GetObjectClass(jarg4); + clazz = jenv->GetObjectClass(jarg5); mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + ba = (jbyteArray)jenv->CallObjectMethod(jarg5, mid); bae = jenv->GetByteArrayElements(ba, 0); sz = jenv->GetArrayLength(ba); - arg4 = 0; + arg5 = 0; if (sz > 0) { - arg4 = (uint64_t)(signed char)bae[0]; + arg5 = (uint64_t)(signed char)bae[0]; for(i=1; iReleaseByteArrayElements(ba, bae, 0); } - result = (int32_t)tiledb_array_open_at(arg1,arg2,arg3,arg4); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open_1with_1key(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3, jint jarg4, jlong jarg5, jlong jarg6) { - jint jresult = 0 ; - tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; - tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; - tiledb_query_type_t arg3 ; + arg6 = *(void **)&jarg6; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg7) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg7); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg7, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg7 = 0; + if (sz > 0) { + arg7 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + result = (int32_t)tiledb_subarray_add_range_var(arg1,arg2,arg3,(void const *)arg4,arg5,(void const *)arg6,arg7); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1add_1range_1var_1by_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jlong jarg4, jobject jarg5, jlong jarg6, jobject jarg7) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + char *arg3 = (char *) 0 ; + void *arg4 = (void *) 0 ; + uint64_t arg5 ; + void *arg6 = (void *) 0 ; + uint64_t arg7 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + arg4 = *(void **)&jarg4; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg5) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg5); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg5, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg5 = 0; + if (sz > 0) { + arg5 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg6 = *(void **)&jarg6; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg7) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg7); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg7, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg7 = 0; + if (sz > 0) { + arg7 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + result = (int32_t)tiledb_subarray_add_range_var_by_name(arg1,arg2,(char const *)arg3,(void const *)arg4,arg5,(void const *)arg6,arg7); + jresult = (jint)result; + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1num(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + uint64_t *arg4 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + arg4 = *(uint64_t **)&jarg4; + result = (int32_t)tiledb_subarray_get_range_num(arg1,(tiledb_subarray_t const *)arg2,arg3,arg4); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1num_1from_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jlong jarg4) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + char *arg3 = (char *) 0 ; + uint64_t *arg4 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + arg4 = *(uint64_t **)&jarg4; + result = (int32_t)tiledb_subarray_get_range_num_from_name(arg1,(tiledb_subarray_t const *)arg2,(char const *)arg3,arg4); + jresult = (jint)result; + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jobject jarg4, jlong jarg5, jlong jarg6, jlong jarg7) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + uint64_t arg4 ; + void **arg5 = (void **) 0 ; + void **arg6 = (void **) 0 ; + void **arg7 = (void **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg5 = *(void ***)&jarg5; + arg6 = *(void ***)&jarg6; + arg7 = *(void ***)&jarg7; + result = (int32_t)tiledb_subarray_get_range(arg1,(tiledb_subarray_t const *)arg2,arg3,arg4,(void const **)arg5,(void const **)arg6,(void const **)arg7); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1from_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jobject jarg4, jlong jarg5, jlong jarg6, jlong jarg7) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + char *arg3 = (char *) 0 ; + uint64_t arg4 ; + void **arg5 = (void **) 0 ; + void **arg6 = (void **) 0 ; + void **arg7 = (void **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg5 = *(void ***)&jarg5; + arg6 = *(void ***)&jarg6; + arg7 = *(void ***)&jarg7; + result = (int32_t)tiledb_subarray_get_range_from_name(arg1,(tiledb_subarray_t const *)arg2,(char const *)arg3,arg4,(void const **)arg5,(void const **)arg6,(void const **)arg7); + jresult = (jint)result; + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1var_1size(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jobject jarg4, jlong jarg5, jlong jarg6) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + uint64_t arg4 ; + uint64_t *arg5 = (uint64_t *) 0 ; + uint64_t *arg6 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg5 = *(uint64_t **)&jarg5; + arg6 = *(uint64_t **)&jarg6; + result = (int32_t)tiledb_subarray_get_range_var_size(arg1,(tiledb_subarray_t const *)arg2,arg3,arg4,arg5,arg6); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1var_1size_1from_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jobject jarg4, jlong jarg5, jlong jarg6) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + char *arg3 = (char *) 0 ; + uint64_t arg4 ; + uint64_t *arg5 = (uint64_t *) 0 ; + uint64_t *arg6 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg5 = *(uint64_t **)&jarg5; + arg6 = *(uint64_t **)&jarg6; + result = (int32_t)tiledb_subarray_get_range_var_size_from_name(arg1,(tiledb_subarray_t const *)arg2,(char const *)arg3,arg4,arg5,arg6); + jresult = (jint)result; + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1var(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jobject jarg4, jlong jarg5, jlong jarg6) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + uint64_t arg4 ; + void *arg5 = (void *) 0 ; + void *arg6 = (void *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg5 = *(void **)&jarg5; + arg6 = *(void **)&jarg6; + result = (int32_t)tiledb_subarray_get_range_var(arg1,(tiledb_subarray_t const *)arg2,arg3,arg4,arg5,arg6); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1get_1range_1var_1from_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jobject jarg4, jlong jarg5, jlong jarg6) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + char *arg3 = (char *) 0 ; + uint64_t arg4 ; + void *arg5 = (void *) 0 ; + void *arg6 = (void *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + arg5 = *(void **)&jarg5; + arg6 = *(void **)&jarg6; + result = (int32_t)tiledb_subarray_get_range_var_from_name(arg1,(tiledb_subarray_t const *)arg2,(char const *)arg3,arg4,arg5,arg6); + jresult = (jint)result; + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1alloc(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + char *arg2 = (char *) 0 ; + tiledb_array_t **arg3 = (tiledb_array_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_array_t ***)&jarg3; + result = (int32_t)tiledb_array_alloc(arg1,(char const *)arg2,arg3); + jresult = (jint)result; + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1set_1open_1timestamp_1start(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + uint64_t arg3 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_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); + } + result = (int32_t)tiledb_array_set_open_timestamp_start(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1set_1open_1timestamp_1end(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + uint64_t arg3 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_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); + } + result = (int32_t)tiledb_array_set_open_timestamp_end(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1get_1open_1timestamp_1start(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + uint64_t *arg3 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_t **)&jarg2; + arg3 = *(uint64_t **)&jarg3; + result = (int32_t)tiledb_array_get_open_timestamp_start(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1get_1open_1timestamp_1end(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + uint64_t *arg3 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_t **)&jarg2; + arg3 = *(uint64_t **)&jarg3; + result = (int32_t)tiledb_array_get_open_timestamp_end(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + tiledb_query_type_t arg3 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_t **)&jarg2; + arg3 = (tiledb_query_type_t)jarg3; + result = (int32_t)tiledb_array_open(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open_1at(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3, jobject jarg4) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + tiledb_query_type_t arg3 ; + uint64_t arg4 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_t **)&jarg2; + arg3 = (tiledb_query_type_t)jarg3; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + result = (int32_t)tiledb_array_open_at(arg1,arg2,arg3,arg4); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1open_1with_1key(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3, jint jarg4, jlong jarg5, jlong jarg6) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_t *arg2 = (tiledb_array_t *) 0 ; + tiledb_query_type_t arg3 ; tiledb_encryption_type_t arg4 ; void *arg5 = (void *) 0 ; uint32_t arg6 ; @@ -11171,6 +11958,24 @@ SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1fragment_1inf } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1fragment_1info_1set_1config(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_fragment_info_t *arg2 = (tiledb_fragment_info_t *) 0 ; + tiledb_config_t *arg3 = (tiledb_config_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_fragment_info_t **)&jarg2; + arg3 = *(tiledb_config_t **)&jarg3; + result = (int32_t)tiledb_fragment_info_set_config(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1fragment_1info_1load(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -11912,6 +12717,96 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema_1evolution_1set_1timestamp_1range(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jobject jarg4) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_schema_evolution_t *arg2 = (tiledb_array_schema_evolution_t *) 0 ; + uint64_t arg3 ; + uint64_t arg4 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_schema_evolution_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); + } + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg4) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg4); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg4 = 0; + if (sz > 0) { + arg4 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + result = (int32_t)tiledb_array_schema_evolution_set_timestamp_range(arg1,arg2,arg3,arg4); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1schema_1timestamp_1range(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_array_schema_t *arg2 = (tiledb_array_schema_t *) 0 ; + uint64_t *arg3 = (uint64_t *) 0 ; + uint64_t *arg4 = (uint64_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_array_schema_t **)&jarg2; + arg3 = *(uint64_t **)&jarg3; + arg4 = *(uint64_t **)&jarg4; + result = (int32_t)tiledb_array_schema_timestamp_range(arg1,arg2,arg3,arg4); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1evolve(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jlong jarg3) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -11958,6 +12853,53 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1array_1upgrad } +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1subarray_1add_1point_1ranges(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg5) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_subarray_t *arg2 = (tiledb_subarray_t *) 0 ; + uint32_t arg3 ; + void *arg4 = (void *) 0 ; + uint64_t arg5 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_subarray_t **)&jarg2; + arg3 = (uint32_t)jarg3; + arg4 = *(void **)&jarg4; + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg5) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return 0; + } + clazz = jenv->GetObjectClass(jarg5); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg5, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg5 = 0; + if (sz > 0) { + arg5 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } + result = (int32_t)tiledb_subarray_add_point_ranges(arg1,arg2,arg3,(void const *)arg4,arg5); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1add_1point_1ranges(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg5) { jint jresult = 0 ; tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; @@ -12005,6 +12947,93 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1add_1p } +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1status_1details_1t_1incomplete_1reason_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + tiledb_query_status_details_t *arg1 = (tiledb_query_status_details_t *) 0 ; + tiledb_query_status_details_reason_t arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(tiledb_query_status_details_t **)&jarg1; + arg2 = (tiledb_query_status_details_reason_t)jarg2; + if (arg1) (arg1)->incomplete_reason = arg2; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1status_1details_1t_1incomplete_1reason_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + tiledb_query_status_details_t *arg1 = (tiledb_query_status_details_t *) 0 ; + tiledb_query_status_details_reason_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(tiledb_query_status_details_t **)&jarg1; + result = (tiledb_query_status_details_reason_t) ((arg1)->incomplete_reason); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_io_tiledb_libtiledb_tiledbJNI_new_1tiledb_1query_1status_1details_1t(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + tiledb_query_status_details_t *result = 0 ; + + (void)jenv; + (void)jcls; + result = (tiledb_query_status_details_t *)new tiledb_query_status_details_t(); + *(tiledb_query_status_details_t **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_delete_1tiledb_1query_1status_1details_1t(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tiledb_query_status_details_t *arg1 = (tiledb_query_status_details_t *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_query_status_details_t **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1query_1get_1status_1details(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jobject jarg3_) { + jint jresult = 0 ; + tiledb_ctx_t *arg1 = (tiledb_ctx_t *) 0 ; + tiledb_query_t *arg2 = (tiledb_query_t *) 0 ; + tiledb_query_status_details_t *arg3 = (tiledb_query_status_details_t *) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + (void)jarg3_; + arg1 = *(tiledb_ctx_t **)&jarg1; + arg2 = *(tiledb_query_t **)&jarg2; + arg3 = *(tiledb_query_status_details_t **)&jarg3; + result = (int32_t)tiledb_query_get_status_details(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1ctx_1alloc_1with_1error(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) { + jint jresult = 0 ; + tiledb_config_t *arg1 = (tiledb_config_t *) 0 ; + tiledb_ctx_t **arg2 = (tiledb_ctx_t **) 0 ; + tiledb_error_t **arg3 = (tiledb_error_t **) 0 ; + int32_t result; + + (void)jenv; + (void)jcls; + arg1 = *(tiledb_config_t **)&jarg1; + arg2 = *(tiledb_ctx_t ***)&jarg2; + arg3 = *(tiledb_error_t ***)&jarg3; + result = (int32_t)tiledb_ctx_alloc_with_error(arg1,arg2,arg3); + jresult = (jint)result; + return jresult; +} + + SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1dimension_1dump_1stdout(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/java/api/ArraySchema.java b/src/main/java/io/tiledb/java/api/ArraySchema.java index c344c5d1..cd365908 100644 --- a/src/main/java/io/tiledb/java/api/ArraySchema.java +++ b/src/main/java/io/tiledb/java/api/ArraySchema.java @@ -602,6 +602,26 @@ public ArraySchema setOffsetsFilterList(FilterList filterList) throws TileDBErro return this; } + /** + * Get timestamp range of schema. + * + * @return timestamp range of schema + * @throws TileDBError + */ + public Pair getTimestampRange() throws TileDBError { + SWIGTYPE_p_unsigned_long_long t1 = tiledb.new_ullp(); + SWIGTYPE_p_unsigned_long_long t2 = tiledb.new_ullp(); + try { + ctx.handleError( + tiledb.tiledb_array_schema_timestamp_range(ctx.getCtxp(), getSchemap(), t1, t2)); + return new Pair(tiledb.ullp_value(t1), tiledb.ullp_value(t2)); + } catch (TileDBError err) { + tiledb.delete_ullp(t1); + tiledb.delete_ullp(t2); + throw err; + } + } + /** * Returns a copy of the FilterList of the offsets. * @@ -647,13 +667,33 @@ public void setAllowDups(int allowsDups) throws TileDBError { * @throws TileDBError */ public int getAllowDups() throws TileDBError { + SWIGTYPE_p_int allowsDupsPtr = tiledb.new_intp(); try { - SWIGTYPE_p_int allowsDupsPtr = tiledb.new_intp(); ctx.handleError( tiledb.tiledb_array_schema_get_allows_dups(ctx.getCtxp(), getSchemap(), allowsDupsPtr)); return tiledb.intp_value(allowsDupsPtr); } catch (TileDBError err) { + tiledb.delete_intp(allowsDupsPtr); + throw err; + } + } + + /** + * Returns the array schema version. + * + * @return the array schema version + * @throws TileDBError + */ + public long getVersion() throws TileDBError { + SWIGTYPE_p_unsigned_int versionPtr = tiledb.new_uintp(); + try { + ctx.handleError( + tiledb.tiledb_array_schema_get_version(ctx.getCtxp(), getSchemap(), versionPtr)); + + return tiledb.uintp_value(versionPtr); + } catch (TileDBError err) { + tiledb.delete_uintp(versionPtr); throw err; } } diff --git a/src/main/java/io/tiledb/java/api/ArraySchemaEvolution.java b/src/main/java/io/tiledb/java/api/ArraySchemaEvolution.java index 8c58c920..f15da146 100644 --- a/src/main/java/io/tiledb/java/api/ArraySchemaEvolution.java +++ b/src/main/java/io/tiledb/java/api/ArraySchemaEvolution.java @@ -3,6 +3,7 @@ import io.tiledb.libtiledb.SWIGTYPE_p_p_tiledb_array_schema_evolution_t; import io.tiledb.libtiledb.SWIGTYPE_p_tiledb_array_schema_evolution_t; import io.tiledb.libtiledb.tiledb; +import java.math.BigInteger; public class ArraySchemaEvolution implements AutoCloseable { private Context ctx; @@ -107,6 +108,23 @@ public void dropAttribute(Attribute att) throws TileDBError { } } + /** + * Sets timestamp range in an array schema evolution. + * + * @param high high value of range + * @param low low value of range + * @throws TileDBError + */ + public void setTimeStampRange(BigInteger high, BigInteger low) throws TileDBError { + try { + ctx.handleError( + tiledb.tiledb_array_schema_evolution_set_timestamp_range( + ctx.getCtxp(), evolutionp, low, high)); + } catch (TileDBError err) { + throw err; + } + } + /** * Evolves the schema of an array. * diff --git a/src/main/java/io/tiledb/java/api/FragmentInfo.java b/src/main/java/io/tiledb/java/api/FragmentInfo.java index 53a117ac..614ed845 100644 --- a/src/main/java/io/tiledb/java/api/FragmentInfo.java +++ b/src/main/java/io/tiledb/java/api/FragmentInfo.java @@ -47,6 +47,23 @@ public FragmentInfo(Context ctx, String uri, EncryptionType encryptionType, Stri } } + /** + * Set the fragment info config. Useful for passing timestamp ranges and encryption key via the + * config before loading the fragment info. + * + * @param config the TileDB config + * @throws TileDBError + */ + public void setConfig(Config config) throws TileDBError { + try { + ctx.handleError( + tiledb.tiledb_fragment_info_set_config( + ctx.getCtxp(), this.fragmentInfop, config.getConfigp())); + } catch (TileDBError err) { + throw err; + } + } + /** * Retrieves the non-empty domain range sizes from a fragment for a given dimension index. * Applicable to var-sized dimensions. diff --git a/src/main/java/io/tiledb/java/api/Query.java b/src/main/java/io/tiledb/java/api/Query.java index af15915b..511e6c2d 100644 --- a/src/main/java/io/tiledb/java/api/Query.java +++ b/src/main/java/io/tiledb/java/api/Query.java @@ -195,6 +195,21 @@ public synchronized Query setSubarray(NativeArray subarray) throws TileDBError { return this; } + /** + * Sets a subarray, defined in the order dimensions were added. Coordinates are inclusive. + * + * @param subarray The targeted subarray. + * @exception TileDBError A TileDB exception + */ + public synchronized Query setSubarray(SubArray subarray) throws TileDBError { + ctx.handleError( + tiledb.tiledb_query_set_subarray_t(ctx.getCtxp(), queryp, subarray.getSubArrayp())); + if (this.subarray != null) { + this.subarray.close(); + } + return this; + } + /** * Sets a subarray, defined in the order dimensions were added. Coordinates are inclusive. * @@ -324,7 +339,7 @@ public synchronized Query addRangeVar(int dimIdx, String start, String end) thro * Retrieves a range's start and end size for a given variable-length dimensions at a given range * index. * - * @param dimIdx The index of the dimension to add the range to + * @param dimIdx The index of the dimension to get the range from * @return This query * @throws TileDBError A TileDB exception */ @@ -347,7 +362,7 @@ public synchronized Pair getRangeVarSize(int dimIdx, BigInteger rang /** * Retrieves a specific range of the query subarray along a given variable-length dimension. * - * @param dimIdx The index of the dimension to add the range to + * @param dimIdx The index of the dimension to get the range from * @return This query * @throws TileDBError A TileDB exception */ @@ -469,9 +484,13 @@ public synchronized Pair getEstResultSizeNullable(Context ctx, Strin */ public long getRangeNum(int dimIdx) throws TileDBError { uint64_tArray resultArr = new uint64_tArray(1); - ctx.handleError( - tiledb.tiledb_query_get_range_num(ctx.getCtxp(), queryp, dimIdx, resultArr.cast())); - return resultArr.getitem(0).longValue(); + try { + ctx.handleError( + tiledb.tiledb_query_get_range_num(ctx.getCtxp(), queryp, dimIdx, resultArr.cast())); + return resultArr.getitem(0).longValue(); + } catch (TileDBError err) { + throw err; + } } /** @@ -1843,7 +1862,7 @@ public String getStats() throws TileDBError { } /** - * TODO + * Sets the QueryCondition for the Query. * * @param queryCondition * @throws TileDBError diff --git a/src/main/java/io/tiledb/java/api/QueryCondition.java b/src/main/java/io/tiledb/java/api/QueryCondition.java index 64b53e3a..33d5f130 100644 --- a/src/main/java/io/tiledb/java/api/QueryCondition.java +++ b/src/main/java/io/tiledb/java/api/QueryCondition.java @@ -42,7 +42,7 @@ public QueryCondition( if (this.type == null) { ctx.handleError( tiledb.tiledb_query_condition_init( - ctx.getCtxp(), conditionp, attributeName, null, BigInteger.valueOf(4), OP)); + ctx.getCtxp(), conditionp, attributeName, null, BigInteger.valueOf(0), OP)); } else { ctx.handleError( tiledb.tiledb_query_condition_init( diff --git a/src/main/java/io/tiledb/java/api/SubArray.java b/src/main/java/io/tiledb/java/api/SubArray.java new file mode 100644 index 00000000..ad6bfcc6 --- /dev/null +++ b/src/main/java/io/tiledb/java/api/SubArray.java @@ -0,0 +1,554 @@ +package io.tiledb.java.api; + +import io.tiledb.libtiledb.SWIGTYPE_p_p_tiledb_subarray_t; +import io.tiledb.libtiledb.SWIGTYPE_p_p_void; +import io.tiledb.libtiledb.SWIGTYPE_p_tiledb_subarray_t; +import io.tiledb.libtiledb.SWIGTYPE_p_unsigned_long_long; +import io.tiledb.libtiledb.tiledb; +import io.tiledb.libtiledb.uint64_tArray; +import java.math.BigInteger; + +public class SubArray implements AutoCloseable { + private SWIGTYPE_p_tiledb_subarray_t subArrayp; + private SWIGTYPE_p_p_tiledb_subarray_t subArraypp; + + private Context ctx; + private Array array; + + public SubArray(Context ctx, Array array) throws TileDBError { + this.ctx = ctx; + this.array = array; + subArraypp = tiledb.new_tiledb_subarray_tpp(); + try { + ctx.handleError(tiledb.tiledb_subarray_alloc(ctx.getCtxp(), array.getArrayp(), subArraypp)); + } catch (TileDBError err) { + tiledb.delete_tiledb_subarray_tpp(subArraypp); + throw err; + } + subArrayp = tiledb.tiledb_subarray_tpp_value(subArraypp); + } + + /** + * Getter for subArray pointer. + * + * @return the subarray pointer + */ + public SWIGTYPE_p_tiledb_subarray_t getSubArrayp() { + return subArrayp; + } + + /** + * Set the query config. + * + *

Setting configuration with this function overrides the following Query-level parameters + * only: + * + *

- `sm.memory_budget` - `sm.memory_budget_var` - `sm.sub_partitioner_memory_budget` - + * `sm.var_offsets.mode` - `sm.var_offsets.extra_element` - `sm.var_offsets.bitsize` - + * `sm.check_coord_dups` - `sm.check_coord_oob` - `sm.check_global_order` - `sm.dedup_coords` + * + * @param config The input configuration + */ + public void setConfig(Config config) throws TileDBError { + try { + ctx.handleError( + tiledb.tiledb_subarray_set_config(ctx.getCtxp(), this.subArrayp, config.getConfigp())); + } catch (TileDBError err) { + throw err; + } + } + + /** + * Adds a 1D range along a subarray dimension index, which is in the form (start, end, stride). + * The datatype of the range components must be the same as the type of the domain of the array in + * the query. + * + * @param dimIdx The index of the dimension to add the range to + * @param start The range start + * @param end The range end + * @param stride The range stride + * @return This subArray + *

Note: The stride is currently unsupported. Use 0/NULL/nullptr as the stride argument. + * @throws TileDBError A TileDB exception + */ + public synchronized SubArray addRange(int dimIdx, Object start, Object end, Object stride) + throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(dimIdx).getType(); + } + + // We use java type check here because we can not tell the difference between unsigned and + // signed + // values coming from java, i.e. A UINT16 and INT32 are both Integer classes in java. + Types.javaTypeCheck(start.getClass(), dimType.javaClass()); + Types.javaTypeCheck(end.getClass(), dimType.javaClass()); + + try (NativeArray startArr = new NativeArray(ctx, 1, dimType); + NativeArray endArr = new NativeArray(ctx, 1, dimType)) { + startArr.setItem(0, start); + endArr.setItem(0, end); + + ctx.handleError( + tiledb.tiledb_subarray_add_range( + ctx.getCtxp(), + subArrayp, + dimIdx, + startArr.toVoidPointer(), + endArr.toVoidPointer(), + null)); + } + + return this; + } + + /** + * Adds point ranges to the given dimension index of the subarray Effectively `add_range(x_i, + * x_i)` for `count` points in the target array, but set in bulk to amortize expensive steps. + * + * @param dimIdx The dimension index + * @param start The range start + * @param count Number of ranges to add + * @return This query + * @throws TileDBError A TileDB exception + */ + public synchronized SubArray addPointRanges(int dimIdx, Object start, BigInteger count) + throws TileDBError { + Datatype dimType; + int values[]; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(dimIdx).getType(); + values = (int[]) start; + } + + try (NativeArray arr = new NativeArray(ctx, values.length, dimType)) { + int i = 0; + for (int value : values) { + arr.setItem(i, value); + i++; + } + ctx.handleError( + tiledb.tiledb_subarray_add_point_ranges( + ctx.getCtxp(), subArrayp, dimIdx, arr.toVoidPointer(), count)); + } + return this; + } + + /** + * Adds a 1D range along a subarray dimension index, which is in the form (start, end, stride). + * The datatype of the range components must be the same as the type of the domain of the array in + * the query. + * + * @param name The name of the dimension to add the range to + * @param start The range start + * @param end The range end + * @param stride The range stride + * @return This subArray + *

Note: The stride is currently unsupported. Use 0/NULL/nullptr as the stride argument. + * @throws TileDBError A TileDB exception + */ + public synchronized SubArray addRangeByName(String name, Object start, Object end, Object stride) + throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(name).getType(); + } + + // We use java type check here because we can not tell the difference between unsigned and + // signed + // values coming from java, i.e. A UINT16 and INT32 are both Integer classes in java. + Types.javaTypeCheck(start.getClass(), dimType.javaClass()); + Types.javaTypeCheck(end.getClass(), dimType.javaClass()); + + try (NativeArray startArr = new NativeArray(ctx, 1, dimType); + NativeArray endArr = new NativeArray(ctx, 1, dimType)) { + startArr.setItem(0, start); + endArr.setItem(0, end); + + ctx.handleError( + tiledb.tiledb_subarray_add_range_by_name( + ctx.getCtxp(), + subArrayp, + name, + startArr.toVoidPointer(), + endArr.toVoidPointer(), + null)); + } + + return this; + } + + /** + * Adds a 1D string range along a subarray dimension index, in the form (start, end). Applicable + * only to variable-sized dimensions + * + * @param dimIdx The index of the dimension to add the range to + * @param start The range start + * @param end The range end + * @return This query + * @throws TileDBError A TileDB exception + */ + public synchronized SubArray addRangeVar(int dimIdx, String start, String end) + throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(dimIdx).getType(); + } + + Types.javaTypeCheck(start.getClass(), dimType.javaClass()); + Types.javaTypeCheck(end.getClass(), dimType.javaClass()); + + try (NativeArray startArr = new NativeArray(ctx, 1, dimType); + NativeArray endArr = new NativeArray(ctx, 1, dimType)) { + startArr.setItem(0, start); + endArr.setItem(0, end); + + ctx.handleError( + tiledb.tiledb_subarray_add_range_var( + ctx.getCtxp(), + subArrayp, + dimIdx, + startArr.toVoidPointer(), + BigInteger.valueOf(start.length()), + endArr.toVoidPointer(), + BigInteger.valueOf(end.length()))); + } + + return this; + } + + /** + * Adds a 1D string range along a subarray dimension index, in the form (start, end). Applicable + * only to variable-sized dimensions + * + * @param name The name of the dimension to add the range to + * @param start The range start + * @param end The range end + * @return This query + * @throws TileDBError A TileDB exception + */ + public synchronized SubArray addRangeVarByName(String name, String start, String end) + throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(name).getType(); + } + + Types.javaTypeCheck(start.getClass(), dimType.javaClass()); + Types.javaTypeCheck(end.getClass(), dimType.javaClass()); + + try (NativeArray startArr = new NativeArray(ctx, 1, dimType); + NativeArray endArr = new NativeArray(ctx, 1, dimType)) { + startArr.setItem(0, start); + endArr.setItem(0, end); + + ctx.handleError( + tiledb.tiledb_subarray_add_range_var_by_name( + ctx.getCtxp(), + subArrayp, + name, + startArr.toVoidPointer(), + BigInteger.valueOf(start.length()), + endArr.toVoidPointer(), + BigInteger.valueOf(end.length()))); + } + + return this; + } + + /** + * Retrieves the number of ranges for a given dimension index. + * + * @param dimIdx The index of the dimension whose range number to retrieve + * @return The number of ranges of the dimension + * @throws TileDBError A TileDB exception + */ + public long getRangeNum(int dimIdx) throws TileDBError { + uint64_tArray resultArr = new uint64_tArray(1); + try { + ctx.handleError( + tiledb.tiledb_subarray_get_range_num(ctx.getCtxp(), subArrayp, dimIdx, resultArr.cast())); + return resultArr.getitem(0).longValue(); + } catch (TileDBError err) { + throw err; + } + } + + /** + * Retrieves the number of ranges for a given dimension index. + * + * @param name The name of the dimension whose range number to retrieve + * @return The number of ranges of the dimension + * @throws TileDBError A TileDB exception + */ + public long getRangeNumFromName(String name) throws TileDBError { + uint64_tArray resultArr = new uint64_tArray(1); + try { + ctx.handleError( + tiledb.tiledb_subarray_get_range_num_from_name( + ctx.getCtxp(), subArrayp, name, resultArr.cast())); + return resultArr.getitem(0).longValue(); + } catch (TileDBError err) { + throw err; + } + } + + /** + * Retrieves a specific range of the subarray along a given dimension. + * + * @param dimIdx The index of the dimension to retrieve the range from + * @param rangeIdx The index of the range to retrieve + * @return Pair of (start, end) of the range. + * @throws TileDBError A TileDB exception + */ + public Pair getRange(int dimIdx, long rangeIdx) throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(dimIdx).getType(); + } + + SWIGTYPE_p_p_void startArrpp = tiledb.new_voidpArray(1); + SWIGTYPE_p_p_void endArrpp = tiledb.new_voidpArray(1); + SWIGTYPE_p_p_void strideArrpp = tiledb.new_voidpArray(1); + + try { + ctx.handleError( + tiledb.tiledb_subarray_get_range( + ctx.getCtxp(), + subArrayp, + dimIdx, + BigInteger.valueOf(rangeIdx), + startArrpp, + endArrpp, + strideArrpp)); + + try (NativeArray startArr = new NativeArray(ctx, dimType, startArrpp, 1); + NativeArray endArr = new NativeArray(ctx, dimType, endArrpp, 1)) { + Object start = startArr.getItem(0); + Object end = endArr.getItem(0); + return new Pair<>(start, end); + } + + } finally { + tiledb.delete_voidpArray(startArrpp); + tiledb.delete_voidpArray(endArrpp); + tiledb.delete_voidpArray(strideArrpp); + } + } + + /** + * Retrieves a specific range of the subarray along a given dimension. + * + * @param name The name of the dimension to retrieve the range from + * @param rangeIdx The index of the range to retrieve + * @return Pair of (start, end) of the range. + * @throws TileDBError A TileDB exception + */ + public Pair getRangeFromName(String name, long rangeIdx) throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(name).getType(); + } + + SWIGTYPE_p_p_void startArrpp = tiledb.new_voidpArray(1); + SWIGTYPE_p_p_void endArrpp = tiledb.new_voidpArray(1); + SWIGTYPE_p_p_void strideArrpp = tiledb.new_voidpArray(1); + + try { + ctx.handleError( + tiledb.tiledb_subarray_get_range_from_name( + ctx.getCtxp(), + subArrayp, + name, + BigInteger.valueOf(rangeIdx), + startArrpp, + endArrpp, + strideArrpp)); + + try (NativeArray startArr = new NativeArray(ctx, dimType, startArrpp, 1); + NativeArray endArr = new NativeArray(ctx, dimType, endArrpp, 1)) { + Object start = startArr.getItem(0); + Object end = endArr.getItem(0); + return new Pair<>(start, end); + } + + } finally { + tiledb.delete_voidpArray(startArrpp); + tiledb.delete_voidpArray(endArrpp); + tiledb.delete_voidpArray(strideArrpp); + } + } + + /** + * Retrieves a range for a given variable length string dimension index and range id. + * + * @param dimIdx The index of the dimension to get the range from + * @return This subArray + * @throws TileDBError A TileDB exception + */ + public synchronized Pair getRangeVarSize(int dimIdx, BigInteger rangeIdx) + throws TileDBError { + SWIGTYPE_p_unsigned_long_long startSize = tiledb.new_ullp(); + SWIGTYPE_p_unsigned_long_long endSize = tiledb.new_ullp(); + try { + ctx.handleError( + tiledb.tiledb_subarray_get_range_var_size( + ctx.getCtxp(), subArrayp, dimIdx, rangeIdx, startSize, endSize)); + + return new Pair( + tiledb.ullp_value(startSize).longValue(), tiledb.ullp_value(endSize).longValue()); + } catch (TileDBError error) { + throw error; + } + } + + /** + * Retrieves a range for a given variable length string dimension index and range id. + * + * @param name The index of the dimension to get the range from + * @return This subArray + * @throws TileDBError A TileDB exception + */ + public synchronized Pair getRangeVarSizeByName(String name, BigInteger rangeIdx) + throws TileDBError { + SWIGTYPE_p_unsigned_long_long startSize = tiledb.new_ullp(); + SWIGTYPE_p_unsigned_long_long endSize = tiledb.new_ullp(); + try { + ctx.handleError( + tiledb.tiledb_subarray_get_range_var_size_from_name( + ctx.getCtxp(), subArrayp, name, rangeIdx, startSize, endSize)); + + return new Pair( + tiledb.ullp_value(startSize).longValue(), tiledb.ullp_value(endSize).longValue()); + } catch (TileDBError error) { + throw error; + } + } + + /** + * Retrieves a range's start and end size for a given variable-length dimension index at a given + * range index. + * + * @param dimIdx The index of the dimension to get the range from + * @return This query + * @throws TileDBError A TileDB exception + */ + public synchronized Pair getRangeVar(int dimIdx, BigInteger rangeIdx) + throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(dimIdx).getType(); + } + + Pair size = this.getRangeVarSize(dimIdx, rangeIdx); + + try (NativeArray startArr = new NativeArray(ctx, size.getFirst().intValue(), dimType); + NativeArray endArr = new NativeArray(ctx, size.getSecond().intValue(), dimType)) { + + ctx.handleError( + tiledb.tiledb_subarray_get_range_var( + ctx.getCtxp(), + subArrayp, + dimIdx, + rangeIdx, + startArr.toVoidPointer(), + endArr.toVoidPointer())); + + Object start = new String((byte[]) startArr.toJavaArray()); + Object end = new String((byte[]) endArr.toJavaArray()); + return new Pair(start, end); + } + } + + /** + * Retrieves a range's start and end size for a given variable-length dimension index at a given + * range index. + * + * @param name The index of the dimension to get the range from + * @return This query + * @throws TileDBError A TileDB exception + */ + public synchronized Pair getRangeVarByName(String name, BigInteger rangeIdx) + throws TileDBError { + Datatype dimType; + try (ArraySchema schema = array.getSchema(); + Domain domain = schema.getDomain()) { + dimType = domain.getDimension(name).getType(); + } + + Pair size = this.getRangeVarSizeByName(name, rangeIdx); + + try (NativeArray startArr = new NativeArray(ctx, size.getFirst().intValue(), dimType); + NativeArray endArr = new NativeArray(ctx, size.getSecond().intValue(), dimType)) { + + ctx.handleError( + tiledb.tiledb_subarray_get_range_var_from_name( + ctx.getCtxp(), + subArrayp, + name, + rangeIdx, + startArr.toVoidPointer(), + endArr.toVoidPointer())); + + Object start = new String((byte[]) startArr.toJavaArray()); + Object end = new String((byte[]) endArr.toJavaArray()); + return new Pair(start, end); + } + } + + /** + * Sets coalesce_ranges flag, intended for use by CAPI, to alloc matching default + * coalesce-ranges=true semantics of internal class constructor, but giving capi clients ability + * to turn off if desired. + * + * @param flag boolean input flag + * @throws TileDBError + */ + public void setCoalesceRanges(boolean flag) throws TileDBError { + short coalesce = flag ? (short) 1 : (short) 0; + + try { + ctx.handleError( + tiledb.tiledb_subarray_set_coalesce_ranges(ctx.getCtxp(), this.subArrayp, coalesce)); + } catch (TileDBError err) { + throw err; + } + } + + /** + * Sets a subarray, defined in the order dimensions were added. Coordinates are inclusive. + * + * @param subarray The targeted subarray. + * @exception TileDBError A TileDB exception + */ + public synchronized SubArray setSubarray(NativeArray subarray) throws TileDBError { + Types.typeCheck(subarray.getNativeType(), array.getSchema().getDomain().getType()); + try { + ctx.handleError( + tiledb.tiledb_subarray_set_subarray(ctx.getCtxp(), subArrayp, subarray.toVoidPointer())); + return this; + } catch (TileDBError err) { + throw err; + } + } + + @Override + public void close() throws Exception { + if (subArrayp != null && subArraypp != null) { + tiledb.tiledb_subarray_free(subArraypp); + subArrayp = null; + subArraypp = null; + if (array != null) { + array.close(); + } + } + } +} diff --git a/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_subarray_t.java b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_subarray_t.java new file mode 100644 index 00000000..6978a74f --- /dev/null +++ b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_p_tiledb_subarray_t.java @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.2 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package io.tiledb.libtiledb; + +public class SWIGTYPE_p_p_tiledb_subarray_t { + private transient long swigCPtr; + + protected SWIGTYPE_p_p_tiledb_subarray_t( + long cPtr, @SuppressWarnings("unused") boolean futureUse) { + swigCPtr = cPtr; + } + + protected SWIGTYPE_p_p_tiledb_subarray_t() { + swigCPtr = 0; + } + + protected static long getCPtr(SWIGTYPE_p_p_tiledb_subarray_t obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } +} diff --git a/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_subarray_t.java b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_subarray_t.java new file mode 100644 index 00000000..a1a57cbe --- /dev/null +++ b/src/main/java/io/tiledb/libtiledb/SWIGTYPE_p_tiledb_subarray_t.java @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.2 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package io.tiledb.libtiledb; + +public class SWIGTYPE_p_tiledb_subarray_t { + private transient long swigCPtr; + + protected SWIGTYPE_p_tiledb_subarray_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { + swigCPtr = cPtr; + } + + protected SWIGTYPE_p_tiledb_subarray_t() { + swigCPtr = 0; + } + + protected static long getCPtr(SWIGTYPE_p_tiledb_subarray_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 fd54355e..836bd5de 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb.java @@ -537,6 +537,33 @@ public static SWIGTYPE_p_tiledb_array_t tiledb_array_tpp_value(SWIGTYPE_p_p_tile return (cPtr == 0) ? null : new SWIGTYPE_p_tiledb_array_t(cPtr, false); } + public static SWIGTYPE_p_p_tiledb_subarray_t new_tiledb_subarray_tpp() { + long cPtr = tiledbJNI.new_tiledb_subarray_tpp(); + return (cPtr == 0) ? null : new SWIGTYPE_p_p_tiledb_subarray_t(cPtr, false); + } + + public static SWIGTYPE_p_p_tiledb_subarray_t copy_tiledb_subarray_tpp( + SWIGTYPE_p_tiledb_subarray_t value) { + long cPtr = tiledbJNI.copy_tiledb_subarray_tpp(SWIGTYPE_p_tiledb_subarray_t.getCPtr(value)); + return (cPtr == 0) ? null : new SWIGTYPE_p_p_tiledb_subarray_t(cPtr, false); + } + + public static void delete_tiledb_subarray_tpp(SWIGTYPE_p_p_tiledb_subarray_t obj) { + tiledbJNI.delete_tiledb_subarray_tpp(SWIGTYPE_p_p_tiledb_subarray_t.getCPtr(obj)); + } + + public static void tiledb_subarray_tpp_assign( + SWIGTYPE_p_p_tiledb_subarray_t obj, SWIGTYPE_p_tiledb_subarray_t value) { + tiledbJNI.tiledb_subarray_tpp_assign( + SWIGTYPE_p_p_tiledb_subarray_t.getCPtr(obj), SWIGTYPE_p_tiledb_subarray_t.getCPtr(value)); + } + + public static SWIGTYPE_p_tiledb_subarray_t tiledb_subarray_tpp_value( + SWIGTYPE_p_p_tiledb_subarray_t obj) { + long cPtr = tiledbJNI.tiledb_subarray_tpp_value(SWIGTYPE_p_p_tiledb_subarray_t.getCPtr(obj)); + return (cPtr == 0) ? null : new SWIGTYPE_p_tiledb_subarray_t(cPtr, false); + } + public static SWIGTYPE_p_p_tiledb_config_t new_tiledb_config_tpp() { long cPtr = tiledbJNI.new_tiledb_config_tpp(); return (cPtr == 0) ? null : new SWIGTYPE_p_p_tiledb_config_t(cPtr, false); @@ -2062,6 +2089,16 @@ public static int tiledb_array_schema_get_allows_dups( SWIGTYPE_p_int.getCPtr(allows_dups)); } + public static int tiledb_array_schema_get_version( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_array_schema_t array_schema, + SWIGTYPE_p_unsigned_int version) { + return tiledbJNI.tiledb_array_schema_get_version( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_array_schema_t.getCPtr(array_schema), + SWIGTYPE_p_unsigned_int.getCPtr(version)); + } + public static int tiledb_array_schema_set_domain( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_array_schema_t array_schema, @@ -2349,6 +2386,16 @@ public static int tiledb_query_set_subarray( SWIGTYPE_p_void.getCPtr(subarray)); } + public static int tiledb_query_set_subarray_t( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_query_t query, + SWIGTYPE_p_tiledb_subarray_t subarray) { + return tiledbJNI.tiledb_query_set_subarray_t( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_query_t.getCPtr(query), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray)); + } + public static int tiledb_query_set_buffer( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_query_t query, @@ -2953,6 +3000,16 @@ public static int tiledb_query_get_fragment_timestamp_range( SWIGTYPE_p_unsigned_long_long.getCPtr(t2)); } + public static int tiledb_query_get_subarray_t( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_query_t query, + SWIGTYPE_p_p_tiledb_subarray_t subarray) { + return tiledbJNI.tiledb_query_get_subarray_t( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_query_t.getCPtr(query), + SWIGTYPE_p_p_tiledb_subarray_t.getCPtr(subarray)); + } + public static int tiledb_query_condition_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_p_tiledb_query_condition_t cond) { return tiledbJNI.tiledb_query_condition_alloc( @@ -2993,6 +3050,240 @@ public static int tiledb_query_condition_combine( SWIGTYPE_p_p_tiledb_query_condition_t.getCPtr(combined_cond)); } + public static int tiledb_subarray_alloc( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_array_t array, + SWIGTYPE_p_p_tiledb_subarray_t subarray) { + return tiledbJNI.tiledb_subarray_alloc( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_array_t.getCPtr(array), + SWIGTYPE_p_p_tiledb_subarray_t.getCPtr(subarray)); + } + + public static int tiledb_subarray_set_config( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + SWIGTYPE_p_tiledb_config_t config) { + return tiledbJNI.tiledb_subarray_set_config( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + SWIGTYPE_p_tiledb_config_t.getCPtr(config)); + } + + public static void tiledb_subarray_free(SWIGTYPE_p_p_tiledb_subarray_t subarray) { + tiledbJNI.tiledb_subarray_free(SWIGTYPE_p_p_tiledb_subarray_t.getCPtr(subarray)); + } + + public static int tiledb_subarray_set_coalesce_ranges( + SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_subarray_t subarray, int coalesce_ranges) { + return tiledbJNI.tiledb_subarray_set_coalesce_ranges( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + coalesce_ranges); + } + + public static int tiledb_subarray_set_subarray( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray_s, + SWIGTYPE_p_void subarray_v) { + return tiledbJNI.tiledb_subarray_set_subarray( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray_s), + SWIGTYPE_p_void.getCPtr(subarray_v)); + } + + public static int tiledb_subarray_add_range( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + SWIGTYPE_p_void start, + SWIGTYPE_p_void end, + SWIGTYPE_p_void stride) { + return tiledbJNI.tiledb_subarray_add_range( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + SWIGTYPE_p_void.getCPtr(start), + SWIGTYPE_p_void.getCPtr(end), + SWIGTYPE_p_void.getCPtr(stride)); + } + + public static int tiledb_subarray_add_range_by_name( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + String dim_name, + SWIGTYPE_p_void start, + SWIGTYPE_p_void end, + SWIGTYPE_p_void stride) { + return tiledbJNI.tiledb_subarray_add_range_by_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_name, + SWIGTYPE_p_void.getCPtr(start), + SWIGTYPE_p_void.getCPtr(end), + SWIGTYPE_p_void.getCPtr(stride)); + } + + public static int tiledb_subarray_add_range_var( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + SWIGTYPE_p_void start, + java.math.BigInteger start_size, + SWIGTYPE_p_void end, + java.math.BigInteger end_size) { + return tiledbJNI.tiledb_subarray_add_range_var( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + SWIGTYPE_p_void.getCPtr(start), + start_size, + SWIGTYPE_p_void.getCPtr(end), + end_size); + } + + public static int tiledb_subarray_add_range_var_by_name( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + String dim_name, + SWIGTYPE_p_void start, + java.math.BigInteger start_size, + SWIGTYPE_p_void end, + java.math.BigInteger end_size) { + return tiledbJNI.tiledb_subarray_add_range_var_by_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_name, + SWIGTYPE_p_void.getCPtr(start), + start_size, + SWIGTYPE_p_void.getCPtr(end), + end_size); + } + + public static int tiledb_subarray_get_range_num( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + SWIGTYPE_p_unsigned_long_long range_num) { + return tiledbJNI.tiledb_subarray_get_range_num( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + SWIGTYPE_p_unsigned_long_long.getCPtr(range_num)); + } + + public static int tiledb_subarray_get_range_num_from_name( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + String dim_name, + SWIGTYPE_p_unsigned_long_long range_num) { + return tiledbJNI.tiledb_subarray_get_range_num_from_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_name, + SWIGTYPE_p_unsigned_long_long.getCPtr(range_num)); + } + + public static int tiledb_subarray_get_range( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + java.math.BigInteger range_idx, + SWIGTYPE_p_p_void start, + SWIGTYPE_p_p_void end, + SWIGTYPE_p_p_void stride) { + return tiledbJNI.tiledb_subarray_get_range( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + range_idx, + SWIGTYPE_p_p_void.getCPtr(start), + SWIGTYPE_p_p_void.getCPtr(end), + SWIGTYPE_p_p_void.getCPtr(stride)); + } + + public static int tiledb_subarray_get_range_from_name( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + String dim_name, + java.math.BigInteger range_idx, + SWIGTYPE_p_p_void start, + SWIGTYPE_p_p_void end, + SWIGTYPE_p_p_void stride) { + return tiledbJNI.tiledb_subarray_get_range_from_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_name, + range_idx, + SWIGTYPE_p_p_void.getCPtr(start), + SWIGTYPE_p_p_void.getCPtr(end), + SWIGTYPE_p_p_void.getCPtr(stride)); + } + + public static int tiledb_subarray_get_range_var_size( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + java.math.BigInteger range_idx, + SWIGTYPE_p_unsigned_long_long start_size, + SWIGTYPE_p_unsigned_long_long end_size) { + return tiledbJNI.tiledb_subarray_get_range_var_size( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + range_idx, + SWIGTYPE_p_unsigned_long_long.getCPtr(start_size), + SWIGTYPE_p_unsigned_long_long.getCPtr(end_size)); + } + + public static int tiledb_subarray_get_range_var_size_from_name( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + String dim_name, + java.math.BigInteger range_idx, + SWIGTYPE_p_unsigned_long_long start_size, + SWIGTYPE_p_unsigned_long_long end_size) { + return tiledbJNI.tiledb_subarray_get_range_var_size_from_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_name, + range_idx, + SWIGTYPE_p_unsigned_long_long.getCPtr(start_size), + SWIGTYPE_p_unsigned_long_long.getCPtr(end_size)); + } + + public static int tiledb_subarray_get_range_var( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + java.math.BigInteger range_idx, + SWIGTYPE_p_void start, + SWIGTYPE_p_void end) { + return tiledbJNI.tiledb_subarray_get_range_var( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + range_idx, + SWIGTYPE_p_void.getCPtr(start), + SWIGTYPE_p_void.getCPtr(end)); + } + + public static int tiledb_subarray_get_range_var_from_name( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + String dim_name, + java.math.BigInteger range_idx, + SWIGTYPE_p_void start, + SWIGTYPE_p_void end) { + return tiledbJNI.tiledb_subarray_get_range_var_from_name( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_name, + range_idx, + SWIGTYPE_p_void.getCPtr(start), + SWIGTYPE_p_void.getCPtr(end)); + } + public static int tiledb_array_alloc( SWIGTYPE_p_tiledb_ctx_t ctx, String array_uri, SWIGTYPE_p_p_tiledb_array_t array) { return tiledbJNI.tiledb_array_alloc( @@ -3820,6 +4111,16 @@ public static void tiledb_fragment_info_free(SWIGTYPE_p_p_tiledb_fragment_info_t tiledbJNI.tiledb_fragment_info_free(SWIGTYPE_p_p_tiledb_fragment_info_t.getCPtr(fragment_info)); } + public static int tiledb_fragment_info_set_config( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_fragment_info_t fragment_info, + SWIGTYPE_p_tiledb_config_t config) { + return tiledbJNI.tiledb_fragment_info_set_config( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_fragment_info_t.getCPtr(fragment_info), + SWIGTYPE_p_tiledb_config_t.getCPtr(config)); + } + public static int tiledb_fragment_info_load( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_fragment_info_t fragment_info) { return tiledbJNI.tiledb_fragment_info_load( @@ -4257,6 +4558,30 @@ public static int tiledb_array_schema_evolution_drop_attribute( attribute_name); } + public static int tiledb_array_schema_evolution_set_timestamp_range( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_array_schema_evolution_t array_schema_evolution, + java.math.BigInteger lo, + java.math.BigInteger hi) { + return tiledbJNI.tiledb_array_schema_evolution_set_timestamp_range( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_array_schema_evolution_t.getCPtr(array_schema_evolution), + lo, + hi); + } + + public static int tiledb_array_schema_timestamp_range( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_array_schema_t array_schema, + SWIGTYPE_p_unsigned_long_long lo, + SWIGTYPE_p_unsigned_long_long hi) { + return tiledbJNI.tiledb_array_schema_timestamp_range( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_array_schema_t.getCPtr(array_schema), + SWIGTYPE_p_unsigned_long_long.getCPtr(lo), + SWIGTYPE_p_unsigned_long_long.getCPtr(hi)); + } + public static int tiledb_array_evolve( SWIGTYPE_p_tiledb_ctx_t ctx, String array_uri, @@ -4275,6 +4600,20 @@ public static int tiledb_array_upgrade_version( SWIGTYPE_p_tiledb_config_t.getCPtr(config)); } + public static int tiledb_subarray_add_point_ranges( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_subarray_t subarray, + long dim_idx, + SWIGTYPE_p_void start, + java.math.BigInteger count) { + return tiledbJNI.tiledb_subarray_add_point_ranges( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_subarray_t.getCPtr(subarray), + dim_idx, + SWIGTYPE_p_void.getCPtr(start), + count); + } + public static int tiledb_query_add_point_ranges( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_query_t query, @@ -4289,6 +4628,27 @@ public static int tiledb_query_add_point_ranges( count); } + public static int tiledb_query_get_status_details( + SWIGTYPE_p_tiledb_ctx_t ctx, + SWIGTYPE_p_tiledb_query_t query, + tiledb_query_status_details_t status) { + return tiledbJNI.tiledb_query_get_status_details( + SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_tiledb_query_t.getCPtr(query), + tiledb_query_status_details_t.getCPtr(status), + status); + } + + public static int tiledb_ctx_alloc_with_error( + SWIGTYPE_p_tiledb_config_t config, + SWIGTYPE_p_p_tiledb_ctx_t ctx, + SWIGTYPE_p_p_tiledb_error_t error) { + return tiledbJNI.tiledb_ctx_alloc_with_error( + SWIGTYPE_p_tiledb_config_t.getCPtr(config), + SWIGTYPE_p_p_tiledb_ctx_t.getCPtr(ctx), + SWIGTYPE_p_p_tiledb_error_t.getCPtr(error)); + } + public static int tiledb_dimension_dump_stdout( SWIGTYPE_p_tiledb_ctx_t ctx, SWIGTYPE_p_tiledb_dimension_t dim) { return tiledbJNI.tiledb_dimension_dump_stdout( diff --git a/src/main/java/io/tiledb/libtiledb/tiledbConstants.java b/src/main/java/io/tiledb/libtiledb/tiledbConstants.java index 27515d4c..bde2dcf0 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledbConstants.java +++ b/src/main/java/io/tiledb/libtiledb/tiledbConstants.java @@ -9,10 +9,11 @@ package io.tiledb.libtiledb; public interface tiledbConstants { + public static final int TILEDB_COMPRESSION_FILTER_DEFAULT_LEVEL = (-30000); public static final int TILEDB_ERR = (-1); 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 = 6; + public static final int TILEDB_VERSION_MINOR = 7; 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 64fceeb0..d50fdd11 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledbJNI.java +++ b/src/main/java/io/tiledb/libtiledb/tiledbJNI.java @@ -437,6 +437,16 @@ public static final native void uint64_tArray_setitem( public static final native long tiledb_array_tpp_value(long jarg1); + public static final native long new_tiledb_subarray_tpp(); + + public static final native long copy_tiledb_subarray_tpp(long jarg1); + + public static final native void delete_tiledb_subarray_tpp(long jarg1); + + public static final native void tiledb_subarray_tpp_assign(long jarg1, long jarg2); + + public static final native long tiledb_subarray_tpp_value(long jarg1); + public static final native long new_tiledb_config_tpp(); public static final native long copy_tiledb_config_tpp(long jarg1); @@ -942,6 +952,9 @@ public static final native int tiledb_array_schema_set_allows_dups( public static final native int tiledb_array_schema_get_allows_dups( long jarg1, long jarg2, long jarg3); + public static final native int tiledb_array_schema_get_version( + long jarg1, long jarg2, long jarg3); + public static final native int tiledb_array_schema_set_domain(long jarg1, long jarg2, long jarg3); public static final native int tiledb_array_schema_set_capacity( @@ -1016,6 +1029,8 @@ public static final native int tiledb_array_schema_has_attribute( public static final native int tiledb_query_set_subarray(long jarg1, long jarg2, long jarg3); + public static final native int tiledb_query_set_subarray_t(long jarg1, long jarg2, long jarg3); + public static final native int tiledb_query_set_buffer( long jarg1, long jarg2, String jarg3, long jarg4, long jarg5); @@ -1177,6 +1192,8 @@ public static final native int tiledb_query_get_fragment_uri( public static final native int tiledb_query_get_fragment_timestamp_range( long jarg1, long jarg2, java.math.BigInteger jarg3, long jarg4, long jarg5); + public static final native int tiledb_query_get_subarray_t(long jarg1, long jarg2, long jarg3); + public static final native int tiledb_query_condition_alloc(long jarg1, long jarg2); public static final native void tiledb_query_condition_free(long jarg1); @@ -1187,6 +1204,77 @@ 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_subarray_alloc(long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_subarray_set_config(long jarg1, long jarg2, long jarg3); + + public static final native void tiledb_subarray_free(long jarg1); + + public static final native int tiledb_subarray_set_coalesce_ranges( + long jarg1, long jarg2, int jarg3); + + public static final native int tiledb_subarray_set_subarray(long jarg1, long jarg2, long jarg3); + + public static final native int tiledb_subarray_add_range( + long jarg1, long jarg2, long jarg3, long jarg4, long jarg5, long jarg6); + + public static final native int tiledb_subarray_add_range_by_name( + long jarg1, long jarg2, String jarg3, long jarg4, long jarg5, long jarg6); + + public static final native int tiledb_subarray_add_range_var( + long jarg1, + long jarg2, + long jarg3, + long jarg4, + java.math.BigInteger jarg5, + long jarg6, + java.math.BigInteger jarg7); + + public static final native int tiledb_subarray_add_range_var_by_name( + long jarg1, + long jarg2, + String jarg3, + long jarg4, + java.math.BigInteger jarg5, + long jarg6, + java.math.BigInteger jarg7); + + public static final native int tiledb_subarray_get_range_num( + long jarg1, long jarg2, long jarg3, long jarg4); + + public static final native int tiledb_subarray_get_range_num_from_name( + long jarg1, long jarg2, String jarg3, long jarg4); + + public static final native int tiledb_subarray_get_range( + long jarg1, + long jarg2, + long jarg3, + java.math.BigInteger jarg4, + long jarg5, + long jarg6, + long jarg7); + + public static final native int tiledb_subarray_get_range_from_name( + long jarg1, + long jarg2, + String jarg3, + java.math.BigInteger jarg4, + long jarg5, + long jarg6, + long jarg7); + + public static final native int tiledb_subarray_get_range_var_size( + long jarg1, long jarg2, long jarg3, java.math.BigInteger jarg4, long jarg5, long jarg6); + + public static final native int tiledb_subarray_get_range_var_size_from_name( + long jarg1, long jarg2, String jarg3, java.math.BigInteger jarg4, long jarg5, long jarg6); + + public static final native int tiledb_subarray_get_range_var( + long jarg1, long jarg2, long jarg3, java.math.BigInteger jarg4, long jarg5, long jarg6); + + public static final native int tiledb_subarray_get_range_var_from_name( + long jarg1, long jarg2, String jarg3, java.math.BigInteger jarg4, long jarg5, long jarg6); + public static final native int tiledb_array_alloc(long jarg1, String jarg2, long jarg3); public static final native int tiledb_array_set_open_timestamp_start( @@ -1415,6 +1503,9 @@ public static final native int tiledb_heap_profiler_enable( public static final native void tiledb_fragment_info_free(long jarg1); + public static final native int tiledb_fragment_info_set_config( + long jarg1, long jarg2, long jarg3); + public static final native int tiledb_fragment_info_load(long jarg1, long jarg2); public static final native int tiledb_fragment_info_load_with_key( @@ -1513,13 +1604,37 @@ public static final native int tiledb_array_schema_evolution_add_attribute( public static final native int tiledb_array_schema_evolution_drop_attribute( long jarg1, long jarg2, String jarg3); + public static final native int tiledb_array_schema_evolution_set_timestamp_range( + long jarg1, long jarg2, java.math.BigInteger jarg3, java.math.BigInteger jarg4); + + public static final native int tiledb_array_schema_timestamp_range( + long jarg1, long jarg2, long jarg3, long jarg4); + public static final native int tiledb_array_evolve(long jarg1, String jarg2, long jarg3); public static final native int tiledb_array_upgrade_version(long jarg1, String jarg2, long jarg3); + public static final native int tiledb_subarray_add_point_ranges( + long jarg1, long jarg2, long jarg3, long jarg4, java.math.BigInteger jarg5); + public static final native int tiledb_query_add_point_ranges( long jarg1, long jarg2, long jarg3, long jarg4, java.math.BigInteger jarg5); + public static final native void tiledb_query_status_details_t_incomplete_reason_set( + long jarg1, tiledb_query_status_details_t jarg1_, int jarg2); + + public static final native int tiledb_query_status_details_t_incomplete_reason_get( + long jarg1, tiledb_query_status_details_t jarg1_); + + public static final native long new_tiledb_query_status_details_t(); + + public static final native void delete_tiledb_query_status_details_t(long jarg1); + + public static final native int tiledb_query_get_status_details( + long jarg1, long jarg2, long jarg3, tiledb_query_status_details_t jarg3_); + + public static final native int tiledb_ctx_alloc_with_error(long jarg1, long jarg2, long jarg3); + public static final native int tiledb_dimension_dump_stdout(long jarg1, long jarg2); public static final native int tiledb_attribute_dump_stdout(long jarg1, long jarg2); diff --git a/src/main/java/io/tiledb/libtiledb/tiledb_datatype_t.java b/src/main/java/io/tiledb/libtiledb/tiledb_datatype_t.java index 4fa3b4ee..227ef501 100644 --- a/src/main/java/io/tiledb/libtiledb/tiledb_datatype_t.java +++ b/src/main/java/io/tiledb/libtiledb/tiledb_datatype_t.java @@ -48,7 +48,8 @@ public enum tiledb_datatype_t { TILEDB_TIME_NS(36), TILEDB_TIME_PS(37), TILEDB_TIME_FS(38), - TILEDB_TIME_AS(39); + TILEDB_TIME_AS(39), + TILEDB_BLOB(40); public final int swigValue() { return swigValue; diff --git a/src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_reason_t.java b/src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_reason_t.java new file mode 100644 index 00000000..e30ba131 --- /dev/null +++ b/src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_reason_t.java @@ -0,0 +1,54 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.2 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package io.tiledb.libtiledb; + +public enum tiledb_query_status_details_reason_t { + TILEDB_REASON_NONE(0), + TILEDB_REASON_USER_BUFFER_SIZE(1), + TILEDB_REASON_MEMORY_BUDGET(2); + + public final int swigValue() { + return swigValue; + } + + public static tiledb_query_status_details_reason_t swigToEnum(int swigValue) { + tiledb_query_status_details_reason_t[] swigValues = + tiledb_query_status_details_reason_t.class.getEnumConstants(); + if (swigValue < swigValues.length + && swigValue >= 0 + && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; + for (tiledb_query_status_details_reason_t swigEnum : swigValues) + if (swigEnum.swigValue == swigValue) return swigEnum; + throw new IllegalArgumentException( + "No enum " + tiledb_query_status_details_reason_t.class + " with value " + swigValue); + } + + @SuppressWarnings("unused") + private tiledb_query_status_details_reason_t() { + this.swigValue = SwigNext.next++; + } + + @SuppressWarnings("unused") + private tiledb_query_status_details_reason_t(int swigValue) { + this.swigValue = swigValue; + SwigNext.next = swigValue + 1; + } + + @SuppressWarnings("unused") + private tiledb_query_status_details_reason_t(tiledb_query_status_details_reason_t swigEnum) { + this.swigValue = swigEnum.swigValue; + SwigNext.next = this.swigValue + 1; + } + + private final int swigValue; + + private static class SwigNext { + private static int next = 0; + } +} diff --git a/src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_t.java b/src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_t.java new file mode 100644 index 00000000..50196e34 --- /dev/null +++ b/src/main/java/io/tiledb/libtiledb/tiledb_query_status_details_t.java @@ -0,0 +1,52 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.2 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package io.tiledb.libtiledb; + +public class tiledb_query_status_details_t { + private transient long swigCPtr; + protected transient boolean swigCMemOwn; + + protected tiledb_query_status_details_t(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(tiledb_query_status_details_t obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + @SuppressWarnings("deprecation") + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + tiledbJNI.delete_tiledb_query_status_details_t(swigCPtr); + } + swigCPtr = 0; + } + } + + public void setIncomplete_reason(tiledb_query_status_details_reason_t value) { + tiledbJNI.tiledb_query_status_details_t_incomplete_reason_set( + swigCPtr, this, value.swigValue()); + } + + public tiledb_query_status_details_reason_t getIncomplete_reason() { + return tiledb_query_status_details_reason_t.swigToEnum( + tiledbJNI.tiledb_query_status_details_t_incomplete_reason_get(swigCPtr, this)); + } + + public tiledb_query_status_details_t() { + this(tiledbJNI.new_tiledb_query_status_details_t(), true); + } +} diff --git a/src/test/java/io/tiledb/java/api/ArraySchemaTest.java b/src/test/java/io/tiledb/java/api/ArraySchemaTest.java index 00baa255..a279310b 100644 --- a/src/test/java/io/tiledb/java/api/ArraySchemaTest.java +++ b/src/test/java/io/tiledb/java/api/ArraySchemaTest.java @@ -144,6 +144,14 @@ public void testArraySchemaSetAllowDups() throws Exception { } } + @Test + public void testArraySchemaVersion() throws Exception { + try (Context ctx = new Context(); + ArraySchema schema = schemaCreate(ctx, ArrayType.TILEDB_SPARSE, layout)) { + Assert.assertEquals(11, schema.getVersion()); + } + } + @Test public void testArraySchemaGetSetAllowDups() throws Exception { try (Context ctx = new Context(); diff --git a/src/test/java/io/tiledb/java/api/FragmentInfoTest.java b/src/test/java/io/tiledb/java/api/FragmentInfoTest.java index c369ceae..79404981 100644 --- a/src/test/java/io/tiledb/java/api/FragmentInfoTest.java +++ b/src/test/java/io/tiledb/java/api/FragmentInfoTest.java @@ -672,6 +672,26 @@ public void testHasConsolidatedMetadataVar() throws Exception { } } + @Test + 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); + + // Get values + // Assert.assertEquals(config.get("vfs.s3.connect_timeout_ms"), "5000"); + // Assert.assertEquals(config.get("vfs.s3.endpoint_override"), "localhost:8888"); + } + } + @Test public void testHasUnconsolidatedMetadataVar() throws Exception { int testFragmentCount = 10; diff --git a/src/test/java/io/tiledb/java/api/MultiRangeQueryTest.java b/src/test/java/io/tiledb/java/api/MultiRangeQueryTest.java index 57e48a54..43873a83 100644 --- a/src/test/java/io/tiledb/java/api/MultiRangeQueryTest.java +++ b/src/test/java/io/tiledb/java/api/MultiRangeQueryTest.java @@ -30,12 +30,14 @@ public void setup() throws Exception { @Test public void test() throws Exception { - arrayRead(); + arrayRead(false); + arrayRead(true); } @Test public void testPointRanges() throws Exception { - arrayReadPointRanges(); + arrayReadPointRanges(false); + arrayReadPointRanges(true); } public void arrayCreate() throws Exception { @@ -91,14 +93,29 @@ public void arrayWrite() throws Exception { } } - private void arrayRead() throws Exception { + private void arrayRead(boolean useSubArray) throws Exception { // Create array and query try (Array array = new Array(ctx, arrayURI, TILEDB_READ); Query query = new Query(array, TILEDB_READ)) { // Slice only rows 1, 2 and cols 2, 3, 4 - query.addRange(0, (int) 1, (int) 2); - query.addRange(1, (int) 2, (int) 4); + + if (useSubArray) { + SubArray subArray = new SubArray(ctx, array); + subArray.addRange(0, (int) 1, (int) 2, null); + subArray.addRange(1, (int) 2, (int) 4, null); + Assert.assertEquals(1, subArray.getRangeNum(0)); + Assert.assertEquals(1, subArray.getRangeNum(1)); + Assert.assertEquals(1, subArray.getRange(0, 0).getFirst()); + Assert.assertEquals(2, subArray.getRange(0, 0).getSecond()); + Assert.assertEquals(2, subArray.getRange(1, 0).getFirst()); + Assert.assertEquals(4, subArray.getRange(1, 0).getSecond()); + query.setSubarray(subArray); + } else { + query.addRange(0, (int) 1, (int) 2); + query.addRange(1, (int) 2, (int) 4); + } + query.setLayout(TILEDB_ROW_MAJOR); Assert.assertEquals(1, query.getRangeNum(0)); @@ -133,7 +150,7 @@ private void arrayRead() throws Exception { } } - private void arrayReadPointRanges() throws Exception { + private void arrayReadPointRanges(boolean useSubArray) throws Exception { // Create array and query try (Array array = new Array(ctx, arrayURI, TILEDB_READ); Query query = new Query(array, TILEDB_READ)) { @@ -141,8 +158,21 @@ private void arrayReadPointRanges() throws Exception { // Slice only rows 1, 2 and cols 2, 3, 4 int[] rangesRows = {1, 2}; int[] rangeColumns = {2, 3, 4}; - query.addPointRanges(0, rangesRows, BigInteger.valueOf(2)); - query.addPointRanges(1, rangeColumns, BigInteger.valueOf(3)); + if (useSubArray) { + SubArray subArray = new SubArray(ctx, array); + subArray.addPointRanges(0, rangesRows, BigInteger.valueOf(2)); + subArray.addPointRanges(1, rangeColumns, BigInteger.valueOf(3)); + Assert.assertEquals(1, subArray.getRangeNum(0)); + Assert.assertEquals(1, subArray.getRangeNum(1)); + Assert.assertEquals(1, subArray.getRange(0, 0).getFirst()); + Assert.assertEquals(2, subArray.getRange(0, 0).getSecond()); + Assert.assertEquals(2, subArray.getRange(1, 0).getFirst()); + Assert.assertEquals(4, subArray.getRange(1, 0).getSecond()); + query.setSubarray(subArray); + } else { + query.addPointRanges(0, rangesRows, BigInteger.valueOf(2)); + query.addPointRanges(1, rangeColumns, BigInteger.valueOf(3)); + } query.setLayout(TILEDB_ROW_MAJOR); Assert.assertEquals(1, query.getRangeNum(0)); diff --git a/src/test/java/io/tiledb/java/api/QueryConditionTest.java b/src/test/java/io/tiledb/java/api/QueryConditionTest.java index 5594faab..b93f010f 100644 --- a/src/test/java/io/tiledb/java/api/QueryConditionTest.java +++ b/src/test/java/io/tiledb/java/api/QueryConditionTest.java @@ -115,7 +115,7 @@ private void arrayRead() throws Exception { Array my_dense_array = new Array(ctx, arrayURI); HashMap dom = my_dense_array.nonEmptyDomain(); - NativeArray subarray = new NativeArray(ctx, new long[] {1l, 4l, 1l, 4l}, Long.class); + NativeArray subarray = new NativeArray(ctx, new long[] {1, 4, 1, 4}, Long.class); // Create query try (Query query = new Query(my_dense_array, TILEDB_READ)) { @@ -138,7 +138,6 @@ private void arrayRead() throws Exception { // Submit query query.submit(); - // System.out.println("Query submitted: " + query.submit() ); // Print cell values (assumes all getAttributes are read) HashMap> result_el = query.resultBufferElements(); @@ -149,21 +148,32 @@ private void arrayRead() throws Exception { // System.out.println(a1_buff[i] + " " + a2_buff[i]); // } + // In the legacy 'sm.query.dense.reader' we expect all cells that satisfy the QC to be + // filtered out. For the refactored reader, which is the default after 2.7, filtered out means + // the value is replaced with the fill value. // check a1 Assert.assertArrayEquals( a1_buff, new int[] { - 13, 16 - }); // the values here even if null are displayed normally because we do not check the - // validity bytemap. This does not effect the result of the experiment since we know - // which values are expected to be null and returned by TileDB. + -2147483648, + -2147483648, + -2147483648, + -2147483648, + -2147483648, + 13, + -2147483648, + -2147483648, + 16 + }); // check a2 - float[] a2_expected = new float[] {15.3f, 19.1f}; - Assert.assertEquals(a2_buff.length, a2_expected.length); - for (int i = 0; i < a2_buff.length; i++) { - Assert.assertEquals(a2_buff[i], a2_expected[i], 0.01f); - } + Assert.assertArrayEquals( + a2_buff, + new float[] { + Float.NaN, Float.NaN, Float.NaN, Float.NaN, Float.NaN, 15.3f, Float.NaN, Float.NaN, + 19.1f + }, + 0.1f); } } diff --git a/swig/tiledb.i b/swig/tiledb.i index f80c2565..a9260a9e 100644 --- a/swig/tiledb.i +++ b/swig/tiledb.i @@ -87,6 +87,7 @@ import java.nio.ByteBuffer; %pointer_functions(tiledb_encryption_type_t, tiledb_encryption_type_tp); %pointer_functions(tiledb_array_t*, tiledb_array_tpp); +%pointer_functions(tiledb_subarray_t*, tiledb_subarray_tpp); %pointer_functions(tiledb_config_t*, tiledb_config_tpp); %pointer_functions(tiledb_config_iter_t*, tiledb_config_iter_tpp); %pointer_functions(tiledb_ctx_t*, tiledb_ctx_tpp); From ccd0c9d20ca017e1d627e79429aa1076d43ee6c0 Mon Sep 17 00:00:00 2001 From: dimitrisstaratzis Date: Fri, 18 Mar 2022 12:32:38 +0200 Subject: [PATCH 2/2] Update to TileDB 2.7.1 --- cmake/Modules/FindTileDB_EP.cmake | 12 ++++++------ gradle.properties | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/Modules/FindTileDB_EP.cmake b/cmake/Modules/FindTileDB_EP.cmake index c8c4abbc..eaec1773 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.7.0/tiledb-windows-x86_64-2.7.0-4f39c6c.zip") - SET(DOWNLOAD_SHA1 "b441e0684a73dbdd3b55d2448e4b32a03bd4750f") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.1/tiledb-windows-x86_64-2.7.1-a942c71.zip") + SET(DOWNLOAD_SHA1 "fd3cd7c72a8c7056445b402622264ca3c3da89cc") elseif(APPLE) # macOS - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.0/tiledb-macos-x86_64-2.7.0-4f39c6c.tar.gz") - SET(DOWNLOAD_SHA1 "f5b7a6ac44e0aed2d2689b9b5f7d51c506e9a9e1") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.1/tiledb-macos-x86_64-2.7.1-a942c71.tar.gz") + SET(DOWNLOAD_SHA1 "07074baf703440c0a54d2eb41eb1f59c53a519f0") else() # Linux - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.0/tiledb-linux-x86_64-2.7.0-4f39c6c.tar.gz") - SET(DOWNLOAD_SHA1 "9fa2c0607ca479fbb9f506e466cd60ad0189a6f6") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.7.1/tiledb-linux-x86_64-2.7.1-a942c71.tar.gz") + SET(DOWNLOAD_SHA1 "d61b01fdd6944f5ae3816426cf66350c54a2d737") endif() ExternalProject_Add(ep_tiledb diff --git a/gradle.properties b/gradle.properties index 04028803..74d4ab9e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ TILEDB_GIT_REPOSITORY=https://github.com/TileDB-Inc/TileDB -TILEDB_GIT_TAG=2.7.0 +TILEDB_GIT_TAG=2.7.1 TILEDB_VERBOSE=ON TILEDB_S3=ON TILEDB_AZURE=OFF