summaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Makefile.am2
-rw-r--r--java/src/hdf/hdf5lib/H5.java45
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java2
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_native_info_t.java4
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_token_t.java2
-rw-r--r--java/src/jni/h5pFAPLImp.c72
-rw-r--r--java/src/jni/h5pFAPLImp.h27
-rw-r--r--java/src/jni/h5sImp.c2
-rw-r--r--java/src/jni/h5sImp.h2
9 files changed, 151 insertions, 7 deletions
diff --git a/java/src/Makefile.am b/java/src/Makefile.am
index b7ad4bd..0df48bd 100644
--- a/java/src/Makefile.am
+++ b/java/src/Makefile.am
@@ -10,7 +10,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 1527dc2..ae1eb3d 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -6687,6 +6687,51 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)
throws HDF5LibraryException;
+ /**
+ * H5Pget_use_file_locking retrieves whether we are using file locking.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_use_file_locking(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pget_use_file_locking retrieves whether we ignore file locks when they are disabled.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_ignore_disabled_file_locking(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pset_file_locking sets parameters related to file locking.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @param use_file_locking
+ * IN: Whether the library will use file locking when opening files (mainly for SWMR semantics).
+ *
+ * @param ignore_when_disabled
+ * IN: Whether file locking will be ignored when disabled on a file system (useful for Lustre).
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native void H5Pset_file_locking(long fapl_id, boolean use_file_locking, boolean ignore_when_disabled)
+ throws HDF5LibraryException;
+
// ///// unimplemented /////
// herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info);
// herr_t H5Pget_vol_id(hid_t plist_id, hid_t *vol_id);
diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
index 8d0cc24..73aaa47 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
@@ -74,7 +74,7 @@ public class H5O_hdr_info_t implements Serializable {
if (this.mesg_present != info.mesg_present)
return false;
if (this.mesg_shared != info.mesg_shared)
- return false;
+ return false;
return true;
}
diff --git a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
index 4e80849..f410a7f 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
@@ -22,7 +22,7 @@ public class H5O_native_info_t implements Serializable {
public H5O_hdr_info_t hdr_info; /* Object header information */
/* Extra metadata storage for obj & attributes */
- public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
+ public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
public H5_ih_info_t attr_info; /* v2 B-tree & heap for attributes */
H5O_native_info_t (H5O_hdr_info_t oheader_info, H5_ih_info_t obj_info, H5_ih_info_t attr_info)
@@ -49,4 +49,4 @@ public class H5O_native_info_t implements Serializable {
return true;
}
-} \ No newline at end of file
+}
diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
index 8ec0b7f..e6d2474 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_token_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
@@ -42,4 +42,4 @@ public class H5O_token_t implements Serializable {
return Arrays.equals(this.data, token.data);
}
-} \ No newline at end of file
+}
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index 9ae8775..dbfbb5a 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -1377,6 +1377,78 @@ done:
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_file_locking
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1file_1locking
+ (JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled)
+{
+ hbool_t use_file_locking_val = TRUE;
+ hbool_t ignore_when_disabled_val = TRUE;
+
+ UNUSED(clss);
+
+ use_file_locking_val = (use_file_locking == JNI_TRUE) ? TRUE : FALSE;
+ ignore_when_disabled_val = (ignore_when_disabled == JNI_TRUE) ? TRUE : FALSE;
+
+ if (H5Pset_file_locking((hid_t)fapl_id, use_file_locking_val, ignore_when_disabled_val) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_use_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t use_file_locking_val = TRUE;
+ hbool_t unused = TRUE;
+ jboolean bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (H5Pget_file_locking((hid_t)fapl_id, &use_file_locking_val, &unused) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (use_file_locking_val == TRUE) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_ignore_disabled_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t ignore_when_disabled_val = TRUE;
+ hbool_t unused = TRUE;
+ jboolean bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (H5Pget_file_locking((hid_t)fapl_id, &unused, &ignore_when_disabled_val) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (ignore_when_disabled_val == TRUE) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
* Signature: (JJ)V
*/
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 9b353e6..b9b4556 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -392,6 +392,33 @@ Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_file_locking
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1file_1locking
+(JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_use_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking
+(JNIEnv *env, jclass clss, jlong fapl_id);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_ignore_disabled_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking
+(JNIEnv *env, jclass clss, jlong fapl_id);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
* Signature: (JJ)V
*/
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index 33d3c2b..3498392 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -165,7 +165,7 @@ done:
/* 10/28/99 -- added code to copy the array -- this is not used,
* but serves as a reminder in case we try to implement this in
* the future....
- */
+ */
/*
* Note: the argument coord is actually long coord[][], which has been
* flattened by the caller.
diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h
index a07d4c5..cea2ebf 100644
--- a/java/src/jni/h5sImp.h
+++ b/java/src/jni/h5sImp.h
@@ -52,7 +52,7 @@ Java_hdf_hdf5lib_H5__1H5Scopy
/* 10/28/99 -- added code to copy the array -- this is not used,
* but serves as a reminder in case we try to implement this in
* the future....
- */
+ */
/*
* Note: the argument coord is actually long coord[][], which has been
* flattened by the caller.