HDFFV-10664 minimized dataset headers for java interface

This commit is contained in:
Allen Byrne 2018-12-31 16:33:59 -06:00
parent fa6077332b
commit c3cad8e5f3
9 changed files with 218 additions and 4 deletions

View File

@ -3229,6 +3229,34 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Fget_mdc_logging_status(long file_id, boolean[] mdc_logging_status)
throws HDF5LibraryException, NullPointerException;
/**
* H5Fget_dset_no_attrs_hint gets the file-level setting to create minimized dataset object headers.
*
* @param file_id
* IN: Identifier of the target file.
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
public synchronized static native boolean H5Fget_dset_no_attrs_hint(long file_id)
throws HDF5LibraryException;
/**
* H5Fset_dset_no_attrs_hint sets the file-level setting to create minimized dataset object headers.
*
* @param file_id
* IN: Identifier of the target file.
*
* @param minimize
* the minimize hint setting
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
public synchronized static native void H5Fset_dset_no_attrs_hint(long file_id, boolean minimize)
throws HDF5LibraryException;
// /////// unimplemented ////////
// herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa);
// herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment);
@ -6922,8 +6950,6 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException,
NullPointerException;
// /////// Dataset creation property list (DCPL) routines ///////
/**
* H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list.
*
@ -6952,6 +6978,36 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException;
/**
* H5Pget_dset_no_attrs_hint accesses the flag for whether or not datasets created by the given dcpl
* will be created with a "minimized" object header.
*
* @param dcpl_id
* IN: Dataset creation property list
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
public synchronized static native boolean H5Pget_dset_no_attrs_hint(long dcpl_id)
throws HDF5LibraryException;
/**
* H5Pset_dset_no_attrs_hint sets the dcpl to minimize (or explicitly to not minimized) dataset object
* headers upon creation.
*
* @param dcpl_id
* IN: Dataset creation property list
*
* @param minimize
* the minimize hint setting
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
public synchronized static native void H5Pset_dset_no_attrs_hint(long dcpl_id, boolean minimize)
throws HDF5LibraryException;
// /////// Dataset access property list (DAPL) routines ///////
/**

View File

@ -636,6 +636,50 @@ Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Fset_dset_no_attrs_hint
* Signature: (JZ)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fset_1dset_1no_1attrs_1hint
(JNIEnv *env, jclass clss, jlong file_id, jboolean minimize)
{
herr_t retVal = -1;
hbool_t minimize_val;
if (minimize == JNI_TRUE)
minimize_val = TRUE;
else
minimize_val = FALSE;
retVal = H5Fset_dset_no_attrs_hint((hid_t)file_id, (hbool_t)minimize_val);
if (retVal < 0)
h5libraryError(env);
}
/*
* Class: hdf_hdf5lib_H5
* Method: H5Fget_dset_no_attrs_hint
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1dset_1no_1attrs_1hint
(JNIEnv *env, jclass clss, jlong file_id)
{
hbool_t minimize = FALSE;
jboolean bval = JNI_FALSE;
if (H5Fget_dset_no_attrs_hint((hid_t)file_id, (hbool_t *)&minimize) < 0) {
h5libraryError(env);
}
else {
if (minimize == TRUE)
bval = JNI_TRUE;
} /* end else */
return bval;
}
#ifdef __cplusplus

View File

@ -255,6 +255,24 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status
(JNIEnv *, jclass, jlong, jbooleanArray);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Fset_dset_no_attrs_hint
* Signature: (JZ)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Fset_1dset_1no_1attrs_1hint
(JNIEnv *, jclass, jlong, jboolean);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Fget_dset_no_attrs_hint
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Fget_1dset_1no_1attrs_1hint
(JNIEnv *, jclass, jlong);
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */

View File

@ -5946,6 +5946,51 @@ Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
return (jint)opts;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_dset_no_attrs_hint
* Signature: (JZ)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Pset_1dset_1no_1attrs_1hint
(JNIEnv *env, jclass clss, jlong dcpl_id, jboolean minimize)
{
herr_t retVal = -1;
hbool_t minimize_val;
if (minimize == JNI_TRUE)
minimize_val = TRUE;
else
minimize_val = FALSE;
retVal = H5Pset_dset_no_attrs_hint((hid_t)dcpl_id, (hbool_t)minimize_val);
if (retVal < 0)
h5libraryError(env);
}
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pget_dset_no_attrs_hint
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1dset_1no_1attrs_1hint
(JNIEnv *env, jclass clss, jlong dcpl_id)
{
hbool_t minimize = FALSE;
jboolean bval = JNI_FALSE;
if (H5Pget_dset_no_attrs_hint((hid_t)dcpl_id, (hbool_t *)&minimize) < 0) {
h5libraryError(env);
}
else {
if (minimize == TRUE)
bval = JNI_TRUE;
} /* end else */
return bval;
}
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */

View File

@ -1614,6 +1614,24 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
(JNIEnv *, jclass, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_dset_no_attrs_hint
* Signature: (JZ)V
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Pset_1dset_1no_1attrs_1hint
(JNIEnv *, jclass, jlong, jboolean);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pget_dset_no_attrs_hint
* Signature: (J)Z
*/
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1dset_1no_1attrs_1hint
(JNIEnv *, jclass, jlong);
#ifdef __cplusplus
} /* end extern "C" */

View File

@ -211,4 +211,21 @@ public class TestH5Dplist {
assertTrue("testH5Dset_extent - H5.H5Dread: ", extend_dset_data[4][8] == 99);
}
@Test
public void testH5P_dset_no_attrs_hint() {
boolean ret_val_id = false;
_createPDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DATASET_CREATE);
try {
H5.H5Pset_dset_no_attrs_hint(H5dcpl_id, true);
ret_val_id = H5.H5Pget_dset_no_attrs_hint(H5dcpl_id);
assertTrue("H5P_dset_no_attrs_hint", ret_val_id);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5P_dset_no_attrs_hint: " + err);
}
}
}

View File

@ -328,4 +328,18 @@ public class TestH5Fbasic {
fail("H5.H5Freset_mdc_hit_rate_stats: " + err);
}
}
@Test
public void testH5F_dset_no_attrs_hint() {
boolean ret_val_id = false;
try {
H5.H5Fset_dset_no_attrs_hint(H5fid, true);
ret_val_id = H5.H5Fget_dset_no_attrs_hint(H5fid);
assertTrue("H5F_dset_no_attrs_hint", ret_val_id);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5F_dset_no_attrs_hint: " + err);
}
}
}

View File

@ -1,7 +1,8 @@
JUnit version 4.11
.testH5P_dset_no_attrs_hint
.testH5Dset_extent
Time: XXXX
OK (1 test)
OK (2 tests)

View File

@ -2,6 +2,7 @@ JUnit version 4.11
.testH5Fget_mdc_size
.testH5Fget_mdc_hit_rate
.testH5Fis_hdf5
.testH5F_dset_no_attrs_hint
.testH5Fget_freespace
.testH5Fclose
.testH5Fget_filesize
@ -18,5 +19,5 @@ JUnit version 4.11
Time: XXXX
OK (16 tests)
OK (17 tests)