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/CMakeLists.txt2
-rw-r--r--java/src/hdf/hdf5lib/H5.java17
-rw-r--r--java/src/hdf/hdf5lib/HDF5Constants.java6
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java102
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java123
-rw-r--r--java/src/jni/h5Constants.c16
-rw-r--r--java/src/jni/h5oImp.c60
-rw-r--r--java/src/jni/h5oImp.h27
-rw-r--r--java/src/jni/h5pFAPLImp.c334
-rw-r--r--java/src/jni/h5pFAPLImp.h36
11 files changed, 721 insertions, 4 deletions
diff --git a/java/src/Makefile.am b/java/src/Makefile.am
index bd55c39..fcdeae9 100644
--- a/java/src/Makefile.am
+++ b/java/src/Makefile.am
@@ -98,6 +98,8 @@ hdf5_java_JAVA = \
${pkgpath}/structs/H5A_info_t.java \
${pkgpath}/structs/H5E_error2_t.java \
${pkgpath}/structs/H5F_info2_t.java \
+ ${pkgpath}/structs/H5FD_hdfs_fapl_t.java \
+ ${pkgpath}/structs/H5FD_ros3_fapl_t.java \
${pkgpath}/structs/H5G_info_t.java \
${pkgpath}/structs/H5L_info_t.java \
${pkgpath}/structs/H5O_info_t.java \
diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt
index c171ea8..be8f60a 100644
--- a/java/src/hdf/hdf5lib/CMakeLists.txt
+++ b/java/src/hdf/hdf5lib/CMakeLists.txt
@@ -73,6 +73,8 @@ set (HDF5_JAVA_HDF_HDF5_STRUCTS_SOURCES
structs/H5AC_cache_config_t.java
structs/H5E_error2_t.java
structs/H5F_info2_t.java
+ structs/H5FD_ros3_fapl_t.java
+ structs/H5FD_hdfs_fapl_t.java
structs/H5G_info_t.java
structs/H5L_info_t.java
structs/H5O_hdr_info_t.java
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index a1a8ede..4b563fd 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -50,6 +50,8 @@ import hdf.hdf5lib.structs.H5AC_cache_config_t;
import hdf.hdf5lib.structs.H5A_info_t;
import hdf.hdf5lib.structs.H5E_error2_t;
import hdf.hdf5lib.structs.H5F_info2_t;
+import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t;
+import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
import hdf.hdf5lib.structs.H5G_info_t;
import hdf.hdf5lib.structs.H5L_info_t;
import hdf.hdf5lib.structs.H5O_info_t;
@@ -5046,10 +5048,9 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException;
- // /////// unimplemented ////////
- // herr_t H5Odisable_mdc_flushes(hid_t object_id);
- // herr_t H5Oenable_mdc_flushes(hid_t object_id);
- // herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled);
+ public synchronized static native void H5Odisable_mdc_flushes(long object_id);
+ public synchronized static native void H5Oenable_mdc_flushes(long object_id);
+ public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id);
// ////////////////////////////////////////////////////////////
// //
@@ -7796,6 +7797,10 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id)
throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
+
+ public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException;
+
/**
* H5Pget_fapl_multi Sets up use of the multi I/O driver.
*
@@ -7880,6 +7885,10 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
+
+ public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException;
+
// /////// unimplemented ////////
// Generic property list routines //
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java
index cb5ed22..2e80f2e 100644
--- a/java/src/hdf/hdf5lib/HDF5Constants.java
+++ b/java/src/hdf/hdf5lib/HDF5Constants.java
@@ -246,6 +246,8 @@ public class HDF5Constants {
public static final long H5FD_SEC2 = H5FD_SEC2();
public static final long H5FD_STDIO = H5FD_STDIO();
public static final long H5FD_WINDOWS = H5FD_WINDOWS();
+ public static final long H5FD_ROS3 = H5FD_ROS3();
+ public static final long H5FD_HDFS = H5FD_HDFS();
public static final int H5FD_LOG_LOC_READ = H5FD_LOG_LOC_READ();
public static final int H5FD_LOG_LOC_WRITE = H5FD_LOG_LOC_WRITE();
public static final int H5FD_LOG_LOC_SEEK = H5FD_LOG_LOC_SEEK();
@@ -1111,6 +1113,10 @@ public class HDF5Constants {
private static native final long H5FD_WINDOWS();
+ private static native final long H5FD_ROS3();
+
+ private static native final long H5FD_HDFS();
+
private static native final int H5FD_LOG_LOC_READ();
private static native final int H5FD_LOG_LOC_WRITE();
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
new file mode 100644
index 0000000..9fcff2e
--- /dev/null
+++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
@@ -0,0 +1,102 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Read-Only HDFS Virtual File Driver (VFD) *
+ * Copyright (c) 2018, The HDF Group. *
+ * *
+ * All rights reserved. *
+ * *
+ * NOTICE: *
+ * All information contained herein is, and remains, the property of The HDF *
+ * Group. The intellectual and technical concepts contained herein are *
+ * proprietary to The HDF Group. Dissemination of this information or *
+ * reproduction of this material is strictly forbidden unless prior written *
+ * permission is obtained from The HDF Group. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package hdf.hdf5lib.structs;
+
+import java.io.Serializable;
+
+/*
+ * Java representation of the HDFS VFD file access property list (fapl)
+ * structure.
+ *
+ * Used for the access of files hosted on the Hadoop Distributed File System.
+ */
+
+public class H5FD_hdfs_fapl_t implements Serializable {
+ private static final long serialVersionUID = 2072473407027648309L;
+
+ private int version;
+ private String namenode_name;
+ private int namenode_port;
+ private String user_name;
+ private String kerberos_ticket_cache;
+ private int stream_buffer_size;
+
+ /*
+ * Create a fapl_t structure with the specified components.
+ */
+ public H5FD_hdfs_fapl_t(
+ String namenode_name,
+ int namenode_port,
+ String user_name,
+ String kerberos_ticket_cache,
+ int stream_buffer_size)
+ {
+ this.version = 1;
+ this.namenode_name = namenode_name;
+ this.namenode_port = namenode_port;
+ this.user_name = user_name;
+ this.kerberos_ticket_cache = kerberos_ticket_cache;
+ this.stream_buffer_size = stream_buffer_size;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+ if (!(o instanceof H5FD_hdfs_fapl_t))
+ return false;
+
+ H5FD_hdfs_fapl_t other = (H5FD_hdfs_fapl_t)o;
+ if (this.version != other.version)
+ return false;
+ if (!this.namenode_name.equals(other.namenode_name))
+ return false;
+ if (this.namenode_port != other.namenode_port)
+ return false;
+ if (!this.user_name.equals(other.user_name))
+ return false;
+ if (!this.kerberos_ticket_cache.equals(other.kerberos_ticket_cache))
+ return false;
+ if (this.stream_buffer_size != other.stream_buffer_size)
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ /* this is a _very bad_ hash algorithm for purposes of hashing! */
+ /* implemented to satisfy the "contract" regarding equality */
+ int k = (int)this.version;
+ k += this.namenode_name.length();
+ k += this.user_name.length();
+ k += this.kerberos_ticket_cache.length();
+ k += namenode_port;
+ k += stream_buffer_size;
+ return k;
+ }
+
+ @Override
+ public String toString() {
+ return "H5FD_hdfs_fapl_t (Version: " + this.version + ") {" +
+ "\n namenode_name: '" + this.namenode_name +
+ "'\n namenode_port: " + this.namenode_port +
+ "\n user_name: '" + this.user_name +
+ "'\n kerberos_ticket_cache: '" + this.kerberos_ticket_cache +
+ "'\n stream_buffer_size: " + this.stream_buffer_size +
+ "\n}\n";
+ }
+}
+
+
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
new file mode 100644
index 0000000..a899e10
--- /dev/null
+++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
@@ -0,0 +1,123 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Read-Only S3 Virtual File Driver (VFD) *
+ * Copyright (c) 2017-2018, The HDF Group. *
+ * *
+ * All rights reserved. *
+ * *
+ * NOTICE: *
+ * All information contained herein is, and remains, the property of The HDF *
+ * Group. The intellectual and technical concepts contained herein are *
+ * proprietary to The HDF Group. Dissemination of this information or *
+ * reproduction of this material is strictly forbidden unless prior written *
+ * permission is obtained from The HDF Group. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package hdf.hdf5lib.structs;
+
+import java.io.Serializable;
+
+/*
+ * Java representation of the ROS3 VFD file access property list (fapl)
+ * structure.
+ *
+ * Used for the access of files hosted remotely on S3 by Amazon.
+ *
+ * For simplicity, implemented assuming that all ROS3 fapls have components:
+ * - version
+ * - authenticate
+ * - aws_region
+ * - secret_id
+ * - secret_key
+ *
+ * Future implementations may be created to enable different fapl "shapes"
+ * depending on provided version.
+ *
+ * proposed:
+ *
+ * H5FD_ros3_fapl_t (super class, has only version field)
+ * H5FD_ros3_fapl_v1_t (extends super with Version 1 components)
+ * H5FD_ros3_fapl_v2_t (extends super with Version 2 components)
+ * and so on, for each version
+ *
+ * "super" is passed around, and is version-checked and re-cast as
+ * appropriate
+ */
+
+public class H5FD_ros3_fapl_t implements Serializable {
+ private static final long serialVersionUID = 8985533001471224030L;
+
+ private int version;
+ private boolean authenticate;
+ private String aws_region;
+ private String secret_id;
+ private String secret_key;
+
+ /**
+ * Create a "default" fapl_t structure, for anonymous access.
+ */
+ public H5FD_ros3_fapl_t () {
+ /* H5FD_ros3_fapl_t("", "", ""); */ /* defer */
+ this.version = 1;
+ this.aws_region = "";
+ this.secret_id = "";
+ this.secret_key = "";
+ }
+
+ /**
+ * Create a fapl_t structure with the specified components.
+ * If all are the empty string, is anonymous (non-authenticating).
+ * Region and ID must both be supplied for authentication.
+ *
+ * @param region "aws region" for authenticating request
+ * @param id "secret id" or "access id" for authenticating request
+ * @param key "secret key" or "access key" for authenticating request
+ */
+ public H5FD_ros3_fapl_t (String region, String id, String key) {
+ this.version = 1; /* must equal H5FD_CURR_ROS3_FAPL_T_VERSION */
+ /* as found in H5FDros3.h */
+ this.aws_region = region;
+ this.secret_id = id;
+ this.secret_key = key;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+ if (!(o instanceof H5FD_ros3_fapl_t))
+ return false;
+
+ H5FD_ros3_fapl_t other = (H5FD_ros3_fapl_t)o;
+ if (this.version != other.version)
+ return false;
+ if (!this.aws_region.equals(other.aws_region))
+ return false;
+ if (!this.secret_key.equals(other.secret_key))
+ return false;
+ if (!this.secret_id.equals(other.secret_id))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ /* this is a _very bad_ hash algorithm for purposes of hashing! */
+ /* implemented to satisfy the "contract" regarding equality */
+ int k = (int)this.version;
+ k += this.aws_region.length();
+ k += this.secret_id.length();
+ k += this.secret_key.length();
+ return k;
+ }
+
+ @Override
+ public String toString() {
+ return "H5FD_ros3_fapl_t (Version:" + this.version + ") {" +
+ "\n aws_region : " + this.aws_region +
+ "\n secret_id : " + this.secret_id +
+ "\n secret_key : " + this.secret_key +
+ "\n}\n";
+ }
+}
+
+
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index b9e320f..9f52b3c 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -453,6 +453,14 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) {
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1FAMILY(JNIEnv *env, jclass cls) { return H5FD_FAMILY; }
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5FD_1HDFS(JNIEnv *env, jclass cls) {
+#ifdef H5_HAVE_LIBHDFS
+ return H5FD_HDFS;
+#else
+ return -1;
+#endif
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1LOG(JNIEnv *env, jclass cls) { return H5FD_LOG; }
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1MPIO(JNIEnv *env, jclass cls) { return H5FD_MPIO; }
@@ -461,6 +469,14 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1MULTI(JNIEnv *env, jclass cls) { return H5F
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1SEC2(JNIEnv *env, jclass cls) { return H5FD_SEC2; }
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5FD_1ROS3(JNIEnv *env, jclass cls) {
+#ifdef H5_HAVE_ROS3_VFD
+ return H5FD_ROS3;
+#else
+ return -1;
+#endif
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1STDIO(JNIEnv *env, jclass cls) { return H5FD_STDIO; }
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) {
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index cc88b81..b49a3e9 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -856,6 +856,66 @@ done:
return;
} /* end Java_hdf_hdf5lib_H5_H5Orefresh */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Odisable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes
+ (JNIEnv *env, jclass clss, jlong loc_id)
+{
+ UNUSED(clss);
+
+ if (H5Odisable_mdc_flushes((hid_t)loc_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oenable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes
+ (JNIEnv *env, jclass clss, jlong loc_id)
+{
+ UNUSED(clss);
+
+ if (H5Oenable_mdc_flushes((hid_t)loc_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oare_mdc_flushes_disabled
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled
+ (JNIEnv *env, jclass clss, jlong loc_id)
+{
+ jboolean bval = JNI_FALSE;
+ hbool_t is_disabled = FALSE;
+
+ UNUSED(clss);
+
+ if (H5Oare_mdc_flushes_disabled((hid_t)loc_id, &is_disabled) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (is_disabled == TRUE)
+ bval = JNI_TRUE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled */
+
#ifdef __cplusplus
diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h
index cb8c776..5241aba 100644
--- a/java/src/jni/h5oImp.h
+++ b/java/src/jni/h5oImp.h
@@ -202,6 +202,33 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Orefresh
(JNIEnv*, jclass, jlong);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Odisable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Odisable_1mdc_1flushes
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oenable_mdc_flushes
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Oenable_1mdc_1flushes
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oare_mdc_flushes_disabled
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled
+ (JNIEnv*, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index acfc853..006707a 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -370,6 +370,179 @@ done:
return (jlong)offset;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1family_1offset */
+/* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_hdfs
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+#ifdef H5_HAVE_LIBHDFS
+ H5FD_hdfs_fapl_t fa;
+ jvalue args[5];
+ jint j_namenode_port = 0;
+ jstring j_namenode_name = NULL;
+ jstring j_user_name = NULL;
+ jstring j_kerb_cache_path = NULL;
+ jint j_stream_buffer_size = 0;
+#endif /* H5_HAVE_LIBHDFS */
+ jobject ret_obj = NULL;
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_LIBHDFS
+ if (H5Pget_fapl_hdfs((hid_t)fapl_id, &fa) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL != fa.namenode_name) {
+ if (NULL == (j_namenode_name = ENVPTR->NewStringUTF(ENVONLY, fa.namenode_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create namenode_name string");
+ }
+ }
+ args[0].l = j_namenode_name;
+
+ args[1].i = (jint)fa.namenode_port;
+
+ if (NULL != fa.user_name) {
+ if (NULL == (j_user_name = ENVPTR->NewStringUTF(ENVONLY, fa.user_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create user_name string");
+ }
+ }
+ args[2].l = j_user_name;
+
+ if (NULL != fa.kerberos_ticket_cache) {
+ if (NULL == (j_kerb_cache_path = ENVPTR->NewStringUTF(ENVONLY, fa.kerberos_ticket_cache))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create kerberos_ticket_cache string");
+ }
+ }
+ args[3].l = j_kerb_cache_path;
+
+ args[4].i = (jint)fa.stream_buffer_size;
+
+ CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_hdfs_fapl_t", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;I)V", args, ret_obj);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_hdfs: not implemented");
+#endif /* H5_HAVE_LIBHDFS */
+
+done:
+ return ret_obj;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_hdfs
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs
+ (JNIEnv *env, jclass clss, jlong fapl_id, jobject fapl_config)
+{
+#ifdef H5_HAVE_LIBHDFS
+ H5FD_hdfs_fapl_t instance;
+ const char *str = NULL;
+ jfieldID fid;
+ jstring j_str;
+ jclass cls;
+#endif /* H5_HAVE_LIBHDFS */
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_LIBHDFS
+ HDmemset(&instance, 0, sizeof(H5FD_hdfs_fapl_t));
+
+ if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, fapl_config)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "version", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.version = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "namenode_name", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config namenode_name not pinned");
+
+ HDstrncpy(instance.namenode_name, str, H5FD__HDFS_NODE_NAME_SPACE + 1);
+ instance.namenode_name[H5FD__HDFS_NODE_NAME_SPACE] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.namenode_name, 0, H5FD__HDFS_NODE_NAME_SPACE + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "namenode_port", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.namenode_port = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "user_name", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config user_name not pinned");
+
+ HDstrncpy(instance.user_name, str, H5FD__HDFS_USER_NAME_SPACE + 1);
+ instance.user_name[H5FD__HDFS_USER_NAME_SPACE] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.user_name, 0, H5FD__HDFS_USER_NAME_SPACE + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "kerberos_ticket_cache", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config kerberos_ticket_cache not pinned");
+
+ HDstrncpy(instance.kerberos_ticket_cache, str, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
+ instance.kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.kerberos_ticket_cache, 0, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "stream_buffer_size", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.stream_buffer_size = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (H5Pset_fapl_hdfs((hid_t)fapl_id, &instance) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_hdfs: not implemented");
+#endif /* H5_HAVE_LIBHDFS */
+
+done:
+ /* NOP */;
+#ifdef H5_HAVE_LIBHDFS
+ if (str)
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+#endif /* H5_HAVE_LIBHDFS */
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs */
+
/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_log
@@ -617,6 +790,167 @@ done:
*/
/*
+ * Class: hdf5_hdf5lib_H5
+ * Method: H5Pget_fapl_ros3
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_ros3_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ H5FD_ros3_fapl_t fa;
+ jvalue args[3];
+ jstring j_aws = NULL;
+ jstring j_id = NULL;
+ jstring j_key = NULL;
+#endif /* H5_HAVE_ROS3_VFD */
+ jobject ret_obj = NULL;
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_ROS3_VFD
+ /* pass fapl and fapl_t instance into library get_fapl */
+ /* store fapl details in ros3_fapl_t instance `fa` */
+ if (H5Pget_fapl_ros3((hid_t)fapl_id, &fa) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL != fa.aws_region) {
+ if (NULL == (j_aws = ENVPTR->NewStringUTF(ENVONLY, fa.aws_region))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create aws_region string");
+ }
+ }
+ args[0].l = j_aws;
+
+ if (NULL != fa.secret_id) {
+ if (NULL == (j_id = ENVPTR->NewStringUTF(ENVONLY, fa.secret_id))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_id string");
+ }
+ }
+ args[1].l = j_id;
+
+ if (NULL != fa.secret_key) {
+ if (NULL == (j_key = ENVPTR->NewStringUTF(ENVONLY, fa.secret_key))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_key string");
+ }
+ }
+ args[2].l = j_key;
+
+ CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_ros3_fapl_t", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, ret_obj);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_ros3: not implemented");
+#endif /* H5_HAVE_ROS3_VFD */
+
+done:
+ return ret_obj;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3 */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_ros3
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_ros3_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3
+ (JNIEnv *env, jclass clss, jlong fapl_id, jobject fapl_config)
+{
+#ifdef H5_HAVE_ROS3_VFD
+ H5FD_ros3_fapl_t instance;
+ const char *str = NULL;
+ jfieldID fid;
+ jstring j_str;
+ jclass cls;
+#endif /* H5_HAVE_ROS3_VFD */
+
+ UNUSED(clss);
+
+#ifdef H5_HAVE_ROS3_VFD
+ HDmemset(&instance, 0, sizeof(H5FD_ros3_fapl_t));
+
+ if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, fapl_config)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "version", "I")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ instance.version = ENVPTR->GetIntField(ENVONLY, fapl_config, fid);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "aws_region", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config aws_region not pinned");
+
+ HDstrncpy(instance.aws_region, str, H5FD_ROS3_MAX_REGION_LEN + 1);
+ instance.aws_region[H5FD_ROS3_MAX_REGION_LEN] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.aws_region, 0, H5FD_ROS3_MAX_REGION_LEN + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "secret_id", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config secret_id not pinned");
+
+ HDstrncpy(instance.secret_id, str, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
+ instance.secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.secret_id, 0, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
+
+ if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "secret_key", "Ljava/lang/String;")))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (NULL == (j_str = (jstring)ENVPTR->GetObjectField(ENVONLY, fapl_config, fid)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if (j_str) {
+ PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config secret_key not pinned");
+
+ HDstrncpy(instance.secret_key, str, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
+ instance.secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN] = '\0';
+
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+ str = NULL;
+ }
+ else
+ HDmemset(instance.secret_key, 0, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
+
+ if (instance.aws_region[0] != '\0' && instance.secret_id[0] !='\0' && instance.secret_key[0] !='\0')
+ instance.authenticate = TRUE;
+
+ if (H5Pset_fapl_ros3((hid_t)fapl_id, &instance) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+#else
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_ros3: not implemented");
+#endif /* H5_HAVE_ROS3_VFD */
+
+done:
+ /* NOP */;
+#ifdef H5_HAVE_ROS3_VFD
+ if (str)
+ UNPIN_JAVA_STRING(ENVONLY, j_str, str);
+#endif /* H5_HAVE_LIBHDFS */
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3 */
+
+/*
* Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_split
* Signature: (JLjava/lang/String;JLjava/lang/String;J)V
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 28b1d95..9b353e6 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -137,6 +137,24 @@ Java_hdf_hdf5lib_H5_H5Pget_1family_1offset
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pget_fapl_hdfs
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_hdfs
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_hdfs_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs
+(JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_log
* Signature: (JLjava/lang/String;JJ)V
*/
@@ -188,6 +206,24 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1multi
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pget_fapl_ros3
+ * Signature: (J)Lhdf/hdf5lib/structs/H5FD_ros3_fapl_t;
+ */
+JNIEXPORT jobject JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3
+(JNIEnv *, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_fapl_ros3
+ * Signature: (JLhdf/hdf5lib/structs/H5FD_ros3_fapl_t;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3
+(JNIEnv *, jclass, jlong, jobject);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_fapl_split
* Signature: (JLjava/lang/String;JLjava/lang/String;J)V
*/