diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-07-12 15:47:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 15:47:06 (GMT) |
commit | ddb0c502ede9d46c43ef0cecee5cb1fc03c5f6b5 (patch) | |
tree | 16fe614a360f7a724dc2b5398eec74fd34547066 /java/src/hdf | |
parent | d0bbd4e8abf64810c7cda15018d8fcce2999f11d (diff) | |
download | hdf5-ddb0c502ede9d46c43ef0cecee5cb1fc03c5f6b5.zip hdf5-ddb0c502ede9d46c43ef0cecee5cb1fc03c5f6b5.tar.gz hdf5-ddb0c502ede9d46c43ef0cecee5cb1fc03c5f6b5.tar.bz2 |
1 10 HDFFV-11310 implement JNI VL support for primitive types (#1858)
* HDFFV-11310 - implement vlen read/write for atomic types.
* HDFFV-11310 - VL read/write function for primitive types
* Add read/write VL option
* fix function name typo
* remove debugging prints
* Remove more debugging code
* Correct note to match change in code.
* HDFFV-11318 add VL references as byte arrays
* Fix unreleased allocations, fix debug
* Fix format
* Fix formatting
* Correct typo
Diffstat (limited to 'java/src/hdf')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 22 | ||||
-rw-r--r-- | java/src/hdf/hdf5lib/HDF5Constants.java | 12 |
2 files changed, 28 insertions, 6 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index b95495a..e96cf06 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -246,7 +246,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = {1, 10, 9}; + public final static int LIB_VERSION[] = {1, 10, 10}; /** * add system property to load library by path @@ -1267,6 +1267,10 @@ public class H5 implements java.io.Serializable { log.trace("H5Aread_string type"); status = H5Aread_string(attr_id, mem_type_id, (String[])obj); } + else if (H5.H5Tget_class(mem_type_id) == HDF5Constants.H5T_VLEN) { + log.trace("H5AreadVL type"); + status = H5AreadVL(attr_id, mem_type_id, (Object[])obj); + } else { // Create a data buffer to hold the data into a Java Array HDFArray theArray = new HDFArray(obj); @@ -1813,6 +1817,10 @@ public class H5 implements java.io.Serializable { log.trace("H5Dwrite_string type"); status = H5Awrite_string(attr_id, mem_type_id, (String[])obj); } + else if (H5.H5Tget_class(mem_type_id) == HDF5Constants.H5T_VLEN) { + log.trace("H5AwriteVL type"); + status = H5AwriteVL(attr_id, mem_type_id, (Object[])obj); + } else { HDFArray theArray = new HDFArray(obj); byte[] buf = theArray.byteify(); @@ -2797,6 +2805,11 @@ public class H5 implements java.io.Serializable { status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (String[])obj); } + else if (H5.H5Tget_class(mem_type_id) == HDF5Constants.H5T_VLEN) { + log.trace("H5DreadVL type"); + status = + H5DreadVL(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (Object[])obj); + } else { // Create a data buffer to hold the data into a Java Array HDFArray theArray = new HDFArray(obj); @@ -3472,6 +3485,11 @@ public class H5 implements java.io.Serializable { status = H5Dwrite_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (String[])obj); } + else if (H5.H5Tget_class(mem_type_id) == HDF5Constants.H5T_VLEN) { + log.trace("H5DwriteVL type"); + status = H5DwriteVL(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + (Object[])obj); + } else { HDFArray theArray = new HDFArray(obj); byte[] buf = theArray.byteify(); @@ -6468,7 +6486,7 @@ public class H5 implements java.io.Serializable { /** * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and - *relative name. + * relative name. * * @param loc_id * IN: File or group identifier specifying location of group in which object is located diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 7c02af9..bcf3eab 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -81,7 +81,8 @@ public class HDF5Constants { H5AC_METADATA_WRITE_STRATEGY_DISTRIBUTED(); /** Don't attempt to increase the size of the cache automatically */ public static final int H5C_incr_off = H5C_incr_off(); - /** Attempt to increase the size of the cache + /** + * Attempt to increase the size of the cache * whenever the average hit rate over the last epoch drops * below the value supplied in the lower_hr_threshold * field @@ -93,19 +94,22 @@ public class HDF5Constants { public static final int H5C_flash_incr_add_space = H5C_flash_incr_add_space(); /** Don't attempt to decrease the size of the cache automatically */ public static final int H5C_decr_off = H5C_decr_off(); - /** Attempt to decrease the size of the cache + /** + * Attempt to decrease the size of the cache * whenever the average hit rate over the last epoch rises * above the value supplied in the upper_hr_threshold * field */ public static final int H5C_decr_threshold = H5C_decr_threshold(); - /** At the end of each epoch, search the cache for + /** + * At the end of each epoch, search the cache for * entries that have not been accessed for at least the number * of epochs specified in the epochs_before_eviction field, and * evict these entries */ public static final int H5C_decr_age_out = H5C_decr_age_out(); - /** Same as age_out, but we only + /** + * Same as age_out, but we only * attempt to reduce the cache size when the hit rate observed * over the last epoch exceeds the value provided in the * upper_hr_threshold field |