Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ The below table references which versions of TileDB-Java are compatible with whi
| 0.10.X | 2.8.X |
| 0.11.X | 2.9.X |
| 0.12.X | 2.10.X |
| 0.13.X | 2.11.X |

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.12.2-SNAPSHOT'
version '0.13.0-SNAPSHOT'

repositories {
jcenter()
Expand Down
12 changes: 6 additions & 6 deletions cmake/Modules/FindTileDB_EP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.2/tiledb-windows-x86_64-2.10.2-9ab84f9.zip")
SET(DOWNLOAD_SHA1 "fe6dac320afb08dd3f2f40f2705306f6eb245f8b")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.0/tiledb-windows-x86_64-2.11.0-34e5dbc.zip")
SET(DOWNLOAD_SHA1 "ae60d7bea72472716cb85631c27f8d2ddc7d7dd7")
elseif(APPLE) # macOS
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.2/tiledb-macos-x86_64-2.10.2-9ab84f9.tar.gz")
SET(DOWNLOAD_SHA1 "2be62a6c48c0bd7aeea786414aa32aef26fe6a64")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.0/tiledb-macos-x86_64-2.11.0-34e5dbc.tar.gz")
SET(DOWNLOAD_SHA1 "56e865574404cb11cbd631c7c25ab0cfd413f9b3")
else() # Linux
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.10.2/tiledb-linux-x86_64-2.10.2-9ab84f9.tar.gz")
SET(DOWNLOAD_SHA1 "03f6d4892f11cbd939660b78c923325396bd600f")
SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.0/tiledb-linux-x86_64-2.11.0-34e5dbc.tar.gz")
SET(DOWNLOAD_SHA1 "c2eb91e352905728edfeb8dc0a6fbfd7bc69ef66")
endif()

ExternalProject_Add(ep_tiledb
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.10.2
TILEDB_GIT_TAG=2.11.0
TILEDB_VERBOSE=ON
TILEDB_S3=ON
TILEDB_AZURE=OFF
Expand Down
30 changes: 30 additions & 0 deletions src/main/c/generated/tiledb_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5489,6 +5489,18 @@ SWIGEXPORT jobject JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1timestamp_
}


SWIGEXPORT jstring JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1timestamps(JNIEnv *jenv, jclass jcls) {
jstring jresult = 0 ;
char *result = 0 ;

(void)jenv;
(void)jcls;
result = (char *)tiledb_timestamps();
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}


SWIGEXPORT void JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1version(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) {
int32_t *arg1 = (int32_t *) 0 ;
int32_t *arg2 = (int32_t *) 0 ;
Expand Down Expand Up @@ -14018,6 +14030,24 @@ SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1mime_1type_1f
}


SWIGEXPORT jint JNICALL Java_io_tiledb_libtiledb_tiledbJNI_tiledb_1fragment_1info_1get_1total_1cell_1num(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 ;
uint64_t *arg3 = (uint64_t *) 0 ;
int32_t result;

(void)jenv;
(void)jcls;
arg1 = *(tiledb_ctx_t **)&jarg1;
arg2 = *(tiledb_fragment_info_t **)&jarg2;
arg3 = *(uint64_t **)&jarg3;
result = (int32_t)tiledb_fragment_info_get_total_cell_num(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 ;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/tiledb/java/api/FilterList.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public Filter getFilter(long idx) throws TileDBError {
return new CheckSumSHA256Filter(this.ctx, _filterpp);
case TILEDB_FILTER_DICTIONARY:
return new DictionaryFilter(this.ctx, _filterpp);
case TILEDB_FILTER_SCALE_FLOAT:
return new FloatScalingFilter(this.ctx, _filterpp);
default:
{
tiledb.delete_tiledb_filter_tpp(_filterpp);
Expand Down
223 changes: 223 additions & 0 deletions src/main/java/io/tiledb/java/api/FloatScalingFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
package io.tiledb.java.api;

import io.tiledb.libtiledb.SWIGTYPE_p_p_tiledb_filter_t;
import io.tiledb.libtiledb.tiledb;
import io.tiledb.libtiledb.tiledb_filter_option_t;
import io.tiledb.libtiledb.tiledb_filter_type_t;

public class FloatScalingFilter extends Filter {

/**
* Constructor.
*
* @param ctx The TileDB context
* @throws TileDBError
*/
public FloatScalingFilter(Context ctx) throws TileDBError {
super(ctx, tiledb_filter_type_t.TILEDB_FILTER_SCALE_FLOAT);
}

/**
* Constructor.
*
* @param ctx The TileDB context
* @param offset The offset param
* @param factor The factor param
* @param byteWidth The byteWidth param
* @throws TileDBError
*/
public FloatScalingFilter(Context ctx, int offset, int factor, int byteWidth) throws TileDBError {
super(ctx, tiledb_filter_type_t.TILEDB_FILTER_SCALE_FLOAT);
try (NativeArray offsetArray =
new NativeArray(
ctx,
new int[] {
offset,
},
Integer.class);
NativeArray factorArray =
new NativeArray(
ctx,
new int[] {
factor,
},
Integer.class);
NativeArray byteWidthArray =
new NativeArray(
ctx,
new int[] {
byteWidth,
},
Integer.class); ) {
ctx.handleError(
tiledb.tiledb_filter_set_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_OFFSET,
offsetArray.toVoidPointer()));
ctx.handleError(
tiledb.tiledb_filter_set_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_FACTOR,
factorArray.toVoidPointer()));
ctx.handleError(
tiledb.tiledb_filter_set_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_BYTEWIDTH,
byteWidthArray.toVoidPointer()));
} catch (TileDBError err) {
super.close();
throw err;
}
}

/**
* Sets the offset param
*
* @param ctx The TileDB context.
* @param offset The offset input.
* @throws TileDBError
*/
public void setOffset(Context ctx, int offset) throws TileDBError {
try (NativeArray offsetArray =
new NativeArray(
ctx,
new int[] {
offset,
},
Integer.class)) {
ctx.handleError(
tiledb.tiledb_filter_set_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_OFFSET,
offsetArray.toVoidPointer()));
} catch (TileDBError err) {
super.close();
throw err;
}
}

/**
* Sets the factor param.
*
* @param ctx The TileDB context
* @param factor The factor input
* @throws TileDBError
*/
public void setFactor(Context ctx, int factor) throws TileDBError {
try (NativeArray offsetArray =
new NativeArray(
ctx,
new int[] {
factor,
},
Integer.class)) {
ctx.handleError(
tiledb.tiledb_filter_set_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_FACTOR,
offsetArray.toVoidPointer()));
} catch (TileDBError err) {
super.close();
throw err;
}
}

/**
* Sets the ByteWidth param.
*
* @param ctx The TileDB context
* @param byteWidth The byteWidth param
* @throws TileDBError
*/
public void setByteWidth(Context ctx, int byteWidth) throws TileDBError {
try (NativeArray offsetArray =
new NativeArray(
ctx,
new int[] {
byteWidth,
},
Integer.class)) {
ctx.handleError(
tiledb.tiledb_filter_set_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_BYTEWIDTH,
offsetArray.toVoidPointer()));
} catch (TileDBError err) {
super.close();
throw err;
}
}

/**
* Constructor.
*
* @param ctx The TileDB Context
* @param filterpp
*/
protected FloatScalingFilter(Context ctx, SWIGTYPE_p_p_tiledb_filter_t filterpp) {
super(ctx, filterpp);
}

/**
* @return The ByteWidth param
* @throws TileDBError
*/
public int getByteWidth() throws TileDBError {
Context ctx = getCtx();
int window;
try (NativeArray byteWidthArray = new NativeArray(ctx, 1, Integer.class)) {
ctx.handleError(
tiledb.tiledb_filter_get_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_BYTEWIDTH,
byteWidthArray.toVoidPointer()));
window = (int) byteWidthArray.getItem(0);
}
return window;
}

/**
* @return The factor param
* @throws TileDBError
*/
public int getFactor() throws TileDBError {
Context ctx = getCtx();
int window;
try (NativeArray factorArray = new NativeArray(ctx, 1, Integer.class)) {
ctx.handleError(
tiledb.tiledb_filter_get_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_FACTOR,
factorArray.toVoidPointer()));
window = (int) factorArray.getItem(0);
}
return window;
}

/**
* @return The offset param
* @throws TileDBError
*/
public int getOffset() throws TileDBError {
Context ctx = getCtx();
int window;
try (NativeArray offsetArray = new NativeArray(ctx, 1, Integer.class)) {
ctx.handleError(
tiledb.tiledb_filter_get_option(
ctx.getCtxp(),
getFilterp(),
tiledb_filter_option_t.TILEDB_SCALE_FLOAT_OFFSET,
offsetArray.toVoidPointer()));
window = (int) offsetArray.getItem(0);
}
return window;
}
}
25 changes: 25 additions & 0 deletions src/main/java/io/tiledb/java/api/FragmentInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,31 @@ public long getFragmentSize(long fragmentID) throws TileDBError {
return tiledb.ullp_value(size).longValue();
}

/**
* Retrieves the number of cells written to the fragments by the user.
*
* <p>Contributions from each fragment to the total are as described in following.
*
* <p>In the case of sparse fragments, this is the number of non-empty cells in the fragment.
*
* <p>In the case of dense fragments, TileDB may add fill values to populate partially populated
* tiles. Those fill values are counted in the returned number of cells. In other words, the cell
* number is derived from the number of *integral* tiles written in the file.
*
* <p>note: The count returned is the cumulative total of cells written to all fragments in the
* current fragment_info entity, i.e. count may effectively include multiples for any cells that
* may be overlapping across the various fragments.
*
* @return The total number of cells.
* @throws TileDBError
*/
public long getTotalCellNum() throws TileDBError {
SWIGTYPE_p_unsigned_long_long cellNum = tiledb.new_ullp();
tiledb.tiledb_fragment_info_get_total_cell_num(ctx.getCtxp(), fragmentInfop, cellNum);

return tiledb.ullp_value(cellNum).longValue();
}

/**
* Returns true if the fragment with the given index is dense.
*
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/io/tiledb/libtiledb/tiledb.java
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,10 @@ public static SWIGTYPE_p_tiledb_array_schema_evolution_t tiledb_array_schema_evo
return (cPtr == 0) ? null : new SWIGTYPE_p_tiledb_array_schema_evolution_t(cPtr, false);
}

public static int tiledb_status(int x) {
return tiledbJNI.tiledb_status(x);
}

public static int tiledb_query_type_to_str(
tiledb_query_type_t query_type, SWIGTYPE_p_p_char str) {
return tiledbJNI.tiledb_query_type_to_str(
Expand Down Expand Up @@ -1348,6 +1352,10 @@ public static java.math.BigInteger tiledb_timestamp_now_ms() {
return tiledbJNI.tiledb_timestamp_now_ms();
}

public static String tiledb_timestamps() {
return tiledbJNI.tiledb_timestamps();
}

public static void tiledb_version(
SWIGTYPE_p_int major, SWIGTYPE_p_int minor, SWIGTYPE_p_int rev) {
tiledbJNI.tiledb_version(
Expand Down Expand Up @@ -5032,6 +5040,16 @@ public static int tiledb_mime_type_from_str(String str, SWIGTYPE_p_tiledb_mime_t
str, SWIGTYPE_p_tiledb_mime_type_t.getCPtr(mime_type));
}

public static int tiledb_fragment_info_get_total_cell_num(
SWIGTYPE_p_tiledb_ctx_t ctx,
SWIGTYPE_p_tiledb_fragment_info_t fragment_info,
SWIGTYPE_p_unsigned_long_long count) {
return tiledbJNI.tiledb_fragment_info_get_total_cell_num(
SWIGTYPE_p_tiledb_ctx_t.getCPtr(ctx),
SWIGTYPE_p_tiledb_fragment_info_t.getCPtr(fragment_info),
SWIGTYPE_p_unsigned_long_long.getCPtr(count));
}

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(
Expand Down
Loading