diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 139 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 24 | ||||
-rw-r--r-- | java/src/jni/h5dImp.h | 16 | ||||
-rw-r--r-- | java/src/jni/h5gImp.c | 24 | ||||
-rw-r--r-- | java/src/jni/h5gImp.h | 16 | ||||
-rw-r--r-- | java/src/jni/h5oImp.c | 24 | ||||
-rw-r--r-- | java/src/jni/h5oImp.h | 16 | ||||
-rw-r--r-- | java/src/jni/h5pImp.c | 46 | ||||
-rw-r--r-- | java/src/jni/h5pImp.h | 17 | ||||
-rw-r--r-- | java/src/jni/h5tImp.c | 24 | ||||
-rw-r--r-- | java/src/jni/h5tImp.h | 16 |
11 files changed, 352 insertions, 10 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7a14f8c..08589c2 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -2072,6 +2072,31 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Dwrite_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dflush causes all buffers associated with a dataset to be immediately flushed to disk without removing the + * data from the cache. + * + * @param dset_id + * IN: Identifier of the dataset to be flushed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Dflush(long dset_id) throws HDF5LibraryException; + + /** + * H5Drefresh causes all buffers associated with a dataset to be cleared and immediately re-loaded with updated + * contents from disk. This function essentially closes the dataset, evicts all metadata associated with it + * from the cache, and then re-opens the dataset. The reopened dataset is automatically re-registered with the same ID. + * + * @param dset_id + * IN: Identifier of the dataset to be refreshed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Drefresh(long dset_id) throws HDF5LibraryException; + // /////// unimplemented //////// // H5_DLL herr_t H5Ddebug(hid_t dset_id); // herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, @@ -3344,6 +3369,32 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Gopen2(long loc_id, String name, long gapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Gflush causes all buffers associated with a group to be immediately flushed to disk without + * removing the data from the cache. + * + * @param group_id + * IN: Identifier of the group to be flushed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Gflush(long group_id) throws HDF5LibraryException; + + /** + * H5Grefresh causes all buffers associated with a group to be cleared and immediately re-loaded + * with updated contents from disk. This function essentially closes the group, evicts all metadata + * associated with it from the cache, and then re-opens the group. The reopened group is automatically + * re-registered with the same ID. + * + * @param group_id + * IN: Identifier of the group to be refreshed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Grefresh(long group_id) throws HDF5LibraryException; + // //////////////////////////////////////////////////////////// // // // H5I: HDF5 1.8 Identifier Interface API Functions // @@ -4347,6 +4398,34 @@ public class H5 implements java.io.Serializable { public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Oflush causes all buffers associated with an object to be immediately flushed to disk without removing + * the data from the cache. object_id can be any named object associated with an HDF5 file including a + * dataset, a group, or a committed datatype. + * + * @param object_id + * IN: Identifier of the object to be flushed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Oflush(long object_id) throws HDF5LibraryException; + + /** + * H5Orefresh causes all buffers associated with an object to be cleared and immediately re-loaded with + * updated contents from disk. This function essentially closes the object, evicts all metadata associated + * with it from the cache, and then re-opens the object. The reopened object is automatically re-registered + * with the same ID. object_id can be any named object associated with an HDF5 file including a + * dataset, a group, or a committed datatype. + * + * @param object_id + * IN: Identifier of the object to be refreshed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException; + // /////// unimplemented //////// // //////////////////////////////////////////////////////////// @@ -5672,6 +5751,40 @@ public class H5 implements java.io.Serializable { public synchronized static native String H5Pget_mdc_log_options(long fapl_id, boolean[] mdc_log_options) throws HDF5LibraryException; + /** + * H5Pget_metadata_read_attempts retrieves the number of read attempts that is set in the file access property list plist_id. + * + * @param plist_id + * IN: File access property list identifier + * + * @return The number of read attempts. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native long H5Pget_metadata_read_attempts(long plist_id) throws HDF5LibraryException; + + /** + * H5Pset_metadata_read_attempts sets the number of reads that the library will try when reading checksummed + * metadata in an HDF5 file opened with SWMR access. When reading such metadata, the library will compare the + * checksum computed for the metadata just read with the checksum stored within the piece of checksum. When + * performing SWMR operations on a file, the checksum check might fail when the library reads data on a system + * that is not atomic. To remedy such situations, the library will repeatedly read the piece of metadata until + * the check passes or finally fails the read when the allowed number of attempts is reached. + * + * @param plist_id + * IN: File access property list identifier + * @param attempts + * IN: The number of read attempts which is a value greater than 0. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts) + throws HDF5LibraryException; + // Dataset creation property list (DCPL) routines // /** @@ -9251,6 +9364,32 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Tvlen_create(long base_id) throws HDF5LibraryException; + /** + * H5Tflush causes all buffers associated with a committed datatype to be immediately flushed to disk + * without removing the data from the cache. + * + * @param dtype_id + * IN: Identifier of the committed datatype to be flushed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Tflush(long dtype_id) throws HDF5LibraryException; + + /** + * H5Trefresh causes all buffers associated with a committed datatype to be cleared and immediately + * re-loaded with updated contents from disk. This function essentially closes the datatype, evicts + * all metadata associated with it from the cache, and then re-opens the datatype. The reopened datatype + * is automatically re-registered with the same ID. + * + * @param dtype_id + * IN: Identifier of the committed datatype to be refreshed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Trefresh(long dtype_id) throws HDF5LibraryException; + // /////// unimplemented //////// // H5T_conv_t H5Tfind(int src_id, int dst_id, H5T_cdata_t *pcdata); diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index f70cb5e..9e03051 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1752,6 +1752,30 @@ Java_hdf_hdf5lib_H5_H5Diterate(JNIEnv *env, jclass clss, jbyteArray buf, jlong b return (jint)status; } /* end Java_hdf_hdf5lib_H5_H5Diterate */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Dflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Dflush(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Dflush((hid_t)loc_id) < 0) + h5libraryError(env); +} + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Drefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Drefresh(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Drefresh((hid_t)loc_id) < 0) + h5libraryError(env); +} + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index 12078e8..0edabfc 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -312,6 +312,22 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Dset_1extent JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Diterate (JNIEnv*, jclass, jbyteArray, jlong, jlong, jobject, jobject); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Dflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Dflush + (JNIEnv*, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Drefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh + (JNIEnv*, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c index 632942a..eab0b02 100644 --- a/java/src/jni/h5gImp.c +++ b/java/src/jni/h5gImp.c @@ -251,6 +251,30 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx(JNIEnv *env, jclass cls, jlong loc_id, return create_H5G_info_t(env, group_info); } /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Gflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Gflush(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Gflush((hid_t)loc_id) < 0) + h5libraryError(env); +} + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Grefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Grefresh(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Grefresh((hid_t)loc_id) < 0) + h5libraryError(env); +} + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h index 2b9bc57..e413652 100644 --- a/java/src/jni/h5gImp.h +++ b/java/src/jni/h5gImp.h @@ -89,6 +89,22 @@ JNIEXPORT jobject JNICALL Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name JNIEXPORT jobject JNICALL Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx (JNIEnv*, jclass, jlong, jstring, jint, jint, jlong, jlong); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Gflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Gflush + (JNIEnv*, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Grefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh + (JNIEnv*, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index c38ec9a..60130fc 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -760,6 +760,30 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id, j return (jlong)retVal; } /* end Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Oflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Oflush(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Oflush((hid_t)loc_id) < 0) + h5libraryError(env); +} + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Orefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Orefresh(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Orefresh((hid_t)loc_id) < 0) + h5libraryError(env); +} + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h index e6889b2..a404145 100644 --- a/java/src/jni/h5oImp.h +++ b/java/src/jni/h5oImp.h @@ -168,6 +168,22 @@ extern "C" { JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx (JNIEnv*, jclass, jlong, jstring, jint, jint, jlong, jlong); + /* + * Class: hdf_hdf5lib_H5 + * Method: H5Oflush + * Signature: (J)V + */ + JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Oflush + (JNIEnv*, jclass, jlong); + + /* + * Class: hdf_hdf5lib_H5 + * Method: H5Orefresh + * Signature: (J)V + */ + JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Orefresh + (JNIEnv*, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index 8ecd81c..5181672 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -2965,16 +2965,10 @@ Java_hdf_hdf5lib_H5_H5Pset_1elink_1acc_1flags(JNIEnv *env, jclass clss, jlong la { herr_t retVal = -1; - if (((unsigned) flags != H5F_ACC_RDWR) && - ((unsigned) flags != H5F_ACC_RDONLY) && - ((unsigned) flags != H5F_ACC_DEFAULT)) { - h5badArgument(env, "H5Pset_elink_acc_flags: invalid flags value"); - } /* end if */ - else { - retVal = H5Pset_elink_acc_flags((hid_t)lapl_id, (unsigned)flags); - if (retVal < 0) - h5libraryError(env); - } /* end else */ + retVal = H5Pset_elink_acc_flags((hid_t)lapl_id, (unsigned)flags); + if (retVal < 0) + h5libraryError(env); + return (jint) retVal; } /* end Java_hdf_hdf5lib_H5_H5Pset_1elink_1acc_1flags */ @@ -5501,6 +5495,38 @@ Java_hdf_hdf5lib_H5_H5Piterate(JNIEnv *env, jclass clss, jlong prop_id, jintArra return status; } /* end Java_hdf_hdf5lib_H5_H5Piterate */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_metadata_read_attempts + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts(JNIEnv *env, jclass clss, jlong plist_id) +{ + unsigned attempts; + if (H5Pget_metadata_read_attempts((hid_t)plist_id, &attempts) < 0) + h5libraryError(env); + + return (jlong) attempts; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_metadata_read_attempts + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts(JNIEnv *env, jclass clss, jlong plist_id, jlong attempts) +{ + if (attempts <= 0) { + h5badArgument(env, "H5Pset_metadata_read_attempts: attempts <= 0"); + } /* end if */ + else { + if(H5Pset_metadata_read_attempts((hid_t)plist_id, (unsigned)attempts) < 0) + h5libraryError(env); + } /* end else */ +} /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index a06a64f..997a8f1 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1329,6 +1329,23 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pinsert2 JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Piterate (JNIEnv*, jclass, jlong, jintArray, jobject, jobject); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_metadata_read_attempts + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts +(JNIEnv *, jclass, jlong); + + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pset_metadata_read_attempts + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts +(JNIEnv *, jclass, jlong, jlong); + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c index 1f587de..7280aed 100644 --- a/java/src/jni/h5tImp.c +++ b/java/src/jni/h5tImp.c @@ -1582,6 +1582,30 @@ Java_hdf_hdf5lib_H5_H5Tconvert(JNIEnv *env, jclass clss, jlong src_id, jlong dst } /* end else */ } /* end Java_hdf_hdf5lib_H5_H5Tconvert */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Tflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Tflush(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Tflush((hid_t)loc_id) < 0) + h5libraryError(env); +} + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Trefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Trefresh(JNIEnv *env, jclass clss, jlong loc_id) +{ + if (H5Trefresh((hid_t)loc_id) < 0) + h5libraryError(env); +} + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h index 9755a91..edaca2f 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -543,6 +543,22 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Tget_1array_1dims2 JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Tconvert (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray, jbyteArray, jlong); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Tflush + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Tflush + (JNIEnv*, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Trefresh + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh + (JNIEnv*, jclass, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ |