diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-06-14 23:07:03 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-06-14 23:07:03 (GMT) |
commit | d3396a79532601bf22e385f94b12e55dfb2c3bd0 (patch) | |
tree | dedf3566ea2ebf40c2d7475e8a50a3f2f0d57774 /java | |
parent | 7a9e13afdb134bafc070cf8bd2087a84fd0d2334 (diff) | |
download | hdf5-d3396a79532601bf22e385f94b12e55dfb2c3bd0.zip hdf5-d3396a79532601bf22e385f94b12e55dfb2c3bd0.tar.gz hdf5-d3396a79532601bf22e385f94b12e55dfb2c3bd0.tar.bz2 |
[svn-r30075] Description:
Bring object/dataset/group/named datatype features from revise_chunks
branch to trunk. Also CMake support for h5format_convert and a bunch of
misc. cleanups.
Tested on:
MacOSX/64 10.11.5 (amazon) w/serial, parallel & production
(h5committest forthcoming)
Diffstat (limited to 'java')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 105 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 27 | ||||
-rw-r--r-- | java/src/jni/h5dImp.h | 18 | ||||
-rw-r--r-- | java/src/jni/h5gImp.c | 27 | ||||
-rw-r--r-- | java/src/jni/h5gImp.h | 18 | ||||
-rw-r--r-- | java/src/jni/h5oImp.c | 27 | ||||
-rw-r--r-- | java/src/jni/h5oImp.h | 18 | ||||
-rw-r--r-- | java/src/jni/h5tImp.c | 25 | ||||
-rw-r--r-- | java/src/jni/h5tImp.h | 18 | ||||
-rw-r--r-- | java/test/JUnit-interface.txt | 10 | ||||
-rw-r--r-- | java/test/TestH5Dparams.java | 10 | ||||
-rw-r--r-- | java/test/TestH5Gbasic.java | 10 | ||||
-rw-r--r-- | java/test/TestH5Oparams.java | 10 | ||||
-rw-r--r-- | java/test/TestH5Tparams.java | 10 |
14 files changed, 332 insertions, 1 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index e7f5fe8..e555a4f 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, @@ -3289,6 +3314,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 // @@ -4290,6 +4341,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 //////// // //////////////////////////////////////////////////////////// @@ -9155,6 +9234,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 330752b..9bcbd5f 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1779,6 +1779,33 @@ Java_hdf_hdf5lib_H5_H5Diterate 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 a44d465..2a91334 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -348,6 +348,24 @@ 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 649ddde1..a2c0de0 100644 --- a/java/src/jni/h5gImp.c +++ b/java/src/jni/h5gImp.c @@ -260,6 +260,33 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx 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); +} /* end Java_hdf_hdf5lib_H5_H5Gflush */ + +/* + * 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); +} /* end Java_hdf_hdf5lib_H5_H5Grefresh */ + + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h index 05c1e39..3113689 100644 --- a/java/src/jni/h5gImp.h +++ b/java/src/jni/h5gImp.h @@ -97,6 +97,24 @@ 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 21723b8..872bb4c 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -779,6 +779,33 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx 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); +} /* end Java_hdf_hdf5lib_H5_H5Oflush */ + +/* + * 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); +} /* end Java_hdf_hdf5lib_H5_H5Orefresh */ + + #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h index 29e08e9..293dc2e 100644 --- a/java/src/jni/h5oImp.h +++ b/java/src/jni/h5oImp.h @@ -186,6 +186,24 @@ 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/h5tImp.c b/java/src/jni/h5tImp.c index dc052bc..55e16f8 100644 --- a/java/src/jni/h5tImp.c +++ b/java/src/jni/h5tImp.c @@ -1640,6 +1640,31 @@ Java_hdf_hdf5lib_H5_H5Tconvert } /* 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 9e6779d..e614082 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -608,6 +608,24 @@ 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 */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 12e67ad..cbd93e0 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -105,7 +105,9 @@ JUnit version 4.11 .testH5Gcreate_null .testH5Gget_info_by_idx_fileid .testH5Gclose_invalid +.testH5Gflush_invalid .testH5Gopen_invalid +.testH5Grefresh_invalid .testH5Gget_info_invalid .testH5Gcreate_invalid .testH5Gcreate_exists @@ -232,9 +234,11 @@ JUnit version 4.11 .testH5Tget_nmembers_invalid .testH5Tarray_create_value_null .testH5Tset_size_invalid +.testH5Tflush_invalid .testH5Tenum_insert_invalid .testH5Tget_array_dims_null .testH5Tget_member_index_null +.testH5Trefresh_invalid .testH5Tset_sign_invalid .testH5Tenum_insert_name_null .testH5Tequal_not @@ -270,6 +274,8 @@ JUnit version 4.11 .testH5Dvlen_reclaim_invalid .testH5Dopen_invalid .testH5Dclose_invalid +.testH5Dflush_invalid +.testH5Drefresh_invalid .testH5Dget_storage_size_invalid .testH5Dget_space_invalid .testH5Dopen_null @@ -564,7 +570,9 @@ JUnit version 4.11 .testH5Oset_comment_by_name_invalid .testH5Oopen_null .testH5Oclose_invalid +.testH5Oflush_invalid .testH5Oget_comment_by_name_invalid +.testH5Orefresh_invalid .testH5Ocopy_null_dest .testH5Olink_invalid .testH5Oget_info_by_idx_invalid @@ -626,7 +634,7 @@ JUnit version 4.11 Time: XXXX -OK (624 tests) +OK (632 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java index f056027..2cdd121 100644 --- a/java/test/TestH5Dparams.java +++ b/java/test/TestH5Dparams.java @@ -131,4 +131,14 @@ public class TestH5Dparams { H5.H5Dget_storage_size(-1); } + @Test(expected = HDF5LibraryException.class) + public void testH5Dflush_invalid() throws Throwable { + H5.H5Dflush(-1); + } + + @Test(expected = HDF5LibraryException.class) + public void testH5Drefresh_invalid() throws Throwable { + H5.H5Drefresh(-1); + } + } diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java index 70acef4..b049e15 100644 --- a/java/test/TestH5Gbasic.java +++ b/java/test/TestH5Gbasic.java @@ -368,4 +368,14 @@ public class TestH5Gbasic { assertNotNull(info); } + @Test(expected = HDF5LibraryException.class) + public void testH5Gflush_invalid() throws Throwable { + H5.H5Gflush(-1); + } + + @Test(expected = HDF5LibraryException.class) + public void testH5Grefresh_invalid() throws Throwable { + H5.H5Grefresh(-1); + } + } diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java index ced66f5..9398940 100644 --- a/java/test/TestH5Oparams.java +++ b/java/test/TestH5Oparams.java @@ -151,4 +151,14 @@ public class TestH5Oparams { H5.H5Oget_comment_by_name(-1, null, -1); } + @Test(expected = HDF5LibraryException.class) + public void testH5Oflush_invalid() throws Throwable { + H5.H5Oflush(-1); + } + + @Test(expected = HDF5LibraryException.class) + public void testH5Orefresh_invalid() throws Throwable { + H5.H5Orefresh(-1); + } + } diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java index 15cc6af..4ebeea7 100644 --- a/java/test/TestH5Tparams.java +++ b/java/test/TestH5Tparams.java @@ -386,4 +386,14 @@ public class TestH5Tparams { H5.H5Tget_native_type(-1); } + @Test(expected = HDF5LibraryException.class) + public void testH5Tflush_invalid() throws Throwable { + H5.H5Tflush(-1); + } + + @Test(expected = HDF5LibraryException.class) + public void testH5Trefresh_invalid() throws Throwable { + H5.H5Trefresh(-1); + } + } |