diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 36 | ||||
-rw-r--r-- | java/src/jni/h5pImp.c | 34 | ||||
-rw-r--r-- | java/src/jni/h5pImp.h | 19 |
3 files changed, 89 insertions, 0 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 789fea5..50faa6d 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -2854,6 +2854,7 @@ public class H5 implements java.io.Serializable { // /////// unimplemented //////// // ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); + // herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); // ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); // /** @@ -5672,6 +5673,41 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_elink_file_cache_size(long fapl_id, int efc_size) 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 // /** diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index 7c71da1..01da210 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -5542,6 +5542,40 @@ Java_hdf_hdf5lib_H5_H5Piterate return (jint)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 2269624..d606b7a 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1473,6 +1473,25 @@ 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" */ |