Skip to content

Commit

Permalink
update to TileDB-2.19.0 (#335)
Browse files Browse the repository at this point in the history
* update to TileDB-2.19.0-rc1

* update to TileDB-2.19.0 and generate new bindings

* update build.gradle

* use ```tiledb_group_get_member_by_{index|name}_v2```
  • Loading branch information
DimitrisStaratzis authored Jan 10, 2024
1 parent 46d0ca8 commit 47a6543
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group 'io.tiledb'
version '0.20.1-SNAPSHOT'
version '0.21.0-SNAPSHOT'

repositories {
jcenter()
Expand Down
21 changes: 11 additions & 10 deletions cmake/Modules/FindTileDB_EP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,30 @@ 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.18.3/tiledb-windows-x86_64-2.18.3-8f8b766.zip")
SET(DOWNLOAD_SHA1 "313cc237c8cab22edaf2745014471d231f185926")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.19.0/tiledb-windows-x86_64-2.19.0-fa30a88a.zip")
SET(DOWNLOAD_SHA1 "ab8b61a35f0776e851c4eedcb1340df4d8cfb4b3")
elseif(APPLE) # macOS

if (CMAKE_OSX_ARCHITECTURES STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)")
message(STATUS "Building for intel mac")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.18.3/tiledb-macos-x86_64-2.18.3-8f8b766.tar.gz")
SET(DOWNLOAD_SHA1 "fbd7515172de977c8ebd553427b7c136a73df299")

SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.19.0/tiledb-macos-x86_64-2.19.0-fa30a88a.tar.gz")
SET(DOWNLOAD_SHA1 "089b3aa8a92df0bd5a8f7515ed8e5b6bacb5ab47")

elseif (CMAKE_OSX_ARCHITECTURES STREQUAL arm64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
message(STATUS "Building for apple silicon mac")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.18.3/tiledb-macos-arm64-2.18.3-8f8b766.tar.gz")
SET(DOWNLOAD_SHA1 "8109bbac66824ee5806cbea93386d66f5b874bc2")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.19.0/tiledb-macos-arm64-2.19.0-fa30a88a.tar.gz")
SET(DOWNLOAD_SHA1 "83acdc7529d50dcf293dbd6bbc81263856c7c74c")
endif()
else() # Linux
if (USE_AVX2)
message(STATUS "Using Linux binaries with AVX2")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.18.3/tiledb-linux-x86_64-2.18.3-8f8b766.tar.gz")
SET(DOWNLOAD_SHA1 "22ccf17c67532ca80fe2c6f06350a267bc839e81")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.19.0/tiledb-linux-x86_64-2.19.0-fa30a88a.tar.gz")
SET(DOWNLOAD_SHA1 "d236688dbeff2536a8938cf8bf0d478b9f6108f6")
else()
message(STATUS "Using Linux binaries without AVX2")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.18.3/tiledb-linux-x86_64-noavx2-2.18.3-8f8b766.tar.gz")
SET(DOWNLOAD_SHA1 "8ea35a77f01ec33304b42275e71c6ccb1f340965")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.19.0/tiledb-linux-x86_64-noavx2-2.19.0-fa30a88a.tar.gz")
SET(DOWNLOAD_SHA1 "b2f8dcbf4ef15d07d9c91904bde147f4beb0907e")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TILEDB_GIT_REPOSITORY=https://github.com/TileDB-Inc/TileDB
TILEDB_GIT_TAG=2.18.3
TILEDB_GIT_TAG=2.19.0
TILEDB_VERBOSE=ON
TILEDB_S3=ON
TILEDB_AZURE=OFF
Expand Down
76 changes: 76 additions & 0 deletions src/main/c/generated/tiledb_wrap.cxx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 39 additions & 11 deletions src/main/java/io/tiledb/java/api/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,28 +194,56 @@ public long getMemberCount() throws TileDBError {
* @return the corresponding member in the group.
* @throws TileDBError
*/
public String getMemberURIByIndex(BigInteger index) throws TileDBError {
public String getMemberByIndexV2(BigInteger index) throws TileDBError {
Util.checkBigIntegerRange(index);
SWIGTYPE_p_tiledb_object_t objtypep = tiledb.new_tiledb_object_tp();
SWIGTYPE_p_p_char uripp = tiledb.new_charpp();
SWIGTYPE_p_p_tiledb_string_handle_t uripp = tiledb.new_tiledb_string_handle_tpp();
TileDBString ts = null;

try {
ctx.handleError(
tiledb.tiledb_group_get_member_by_index(
tiledb.tiledb_group_get_member_by_index_v2(
ctx.getCtxp(), getGroupp(), index, uripp, objtypep, uripp));
return tiledb.charpp_value(uripp);
ts = new TileDBString(ctx, uripp);
return ts.getView().getFirst();
} finally {
tiledb.delete_charpp(uripp);
if (ts != null) ts.close();
tiledb.delete_tiledb_object_tp(objtypep);
}
}

/**
* Get the URI of a member of a group by name
*
* @param name the name of the member
* @return the URI of the member with the given name
* @throws TileDBError
*/
public String getMemberByNameV2(String name) throws TileDBError {
SWIGTYPE_p_tiledb_object_t objtypep = tiledb.new_tiledb_object_tp();
SWIGTYPE_p_p_tiledb_string_handle_t uripp = tiledb.new_tiledb_string_handle_tpp();
TileDBString ts = null;

try {
ctx.handleError(
tiledb.tiledb_group_get_member_by_name_v2(
ctx.getCtxp(), getGroupp(), name, uripp, objtypep));
ts = new TileDBString(ctx, uripp);
return ts.getView().getFirst();
} finally {
if (ts != null) ts.close();
tiledb.delete_tiledb_object_tp(objtypep);
}
}

@Deprecated
/**
* Get the URI of a member of a group by name
*
* @param name the name of the member
* @return the URI of the member with the given name
* @throws TileDBError
* @deprecated is replaced by getMemberByNameV2(String name);
*/
public String getMemberURIByName(String name) throws TileDBError {
SWIGTYPE_p_tiledb_object_t objtypep = tiledb.new_tiledb_object_tp();
Expand All @@ -232,27 +260,27 @@ public String getMemberURIByName(String name) throws TileDBError {
}
}

@Deprecated
/**
* Get the name of a member of a group by index and details of group
* Get the URI of a member of a group by index and details of group
*
* @param index the index of the member.
* @return the corresponding member in the group.
* @throws TileDBError
* @deprecated is replaced by getMemberByIndexV2(BigInteger index)
*/
public String getMemberNameByIndex(BigInteger index) throws TileDBError {
public String getMemberURIByIndex(BigInteger index) throws TileDBError {
Util.checkBigIntegerRange(index);
SWIGTYPE_p_tiledb_object_t objtypep = tiledb.new_tiledb_object_tp();
SWIGTYPE_p_p_char uripp = tiledb.new_charpp();
SWIGTYPE_p_p_char namepp = tiledb.new_charpp();

try {
ctx.handleError(
tiledb.tiledb_group_get_member_by_index(
ctx.getCtxp(), getGroupp(), index, uripp, objtypep, namepp));
return tiledb.charpp_value(namepp);
ctx.getCtxp(), getGroupp(), index, uripp, objtypep, uripp));
return tiledb.charpp_value(uripp);
} finally {
tiledb.delete_charpp(uripp);
tiledb.delete_charpp(namepp);
tiledb.delete_tiledb_object_tp(objtypep);
}
}
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/io/tiledb/libtiledb/tiledb.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/main/java/io/tiledb/libtiledb/tiledbConstants.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/java/io/tiledb/libtiledb/tiledbJNI.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/test/java/io/tiledb/java/api/ArraySchemaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void testArraySchemaSetAllowDups() throws Exception {
public void testArraySchemaVersion() throws Exception {
try (Context ctx = new Context();
ArraySchema schema = schemaCreate(ctx, ArrayType.TILEDB_SPARSE, layout)) {
Assert.assertEquals(20, schema.getVersion());
Assert.assertEquals(21, schema.getVersion());
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/test/java/io/tiledb/java/api/GroupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ public void membersTest() throws Exception {
group.reopen(ctx, QueryType.TILEDB_READ);
Assert.assertEquals(3, group.getMemberCount());

// test getters
String[] uri = group.getMemberByNameV2("array3Name").split("/");
Assert.assertEquals("TileDB-Java/array3", uri[uri.length - 2] + "/" + uri[uri.length - 1]);

Assert.assertEquals("array2Name", group.getMemberByIndexV2(new BigInteger("1")));

// remove a member
group.reopen(ctx, TILEDB_WRITE);
group.removeMember("array2");
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/tiledb/java/api/VersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void testVersion() {
Version version = new Version();
System.out.println(version);
Assert.assertTrue(version.getMajor() == 2);
Assert.assertTrue(version.getMinor() == 18);
Assert.assertTrue(version.getRevision() == 3);
Assert.assertTrue(version.getMinor() == 19);
Assert.assertTrue(version.getRevision() == 0);
}
}

0 comments on commit 47a6543

Please sign in to comment.