Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-18 09:16:02

0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0002  * Copyright by The HDF Group.                                               *
0003  * All rights reserved.                                                      *
0004  *                                                                           *
0005  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
0006  * terms governing use, modification, and redistribution, is contained in    *
0007  * the COPYING file, which can be found at the root of the source code       *
0008  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
0009  * If you do not have access to either file, you may request a copy from     *
0010  * help@hdfgroup.org.                                                        *
0011  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
0012 
0013 /*
0014  * Purpose: The public header file for the Hadoop Distributed File System
0015  *          (hdfs) virtual file driver (VFD)
0016  */
0017 
0018 #ifndef H5FDhdfs_H
0019 #define H5FDhdfs_H
0020 
0021 #ifdef H5_HAVE_LIBHDFS
0022 
0023 /** Initializer for the hdfs VFD */
0024 #define H5FD_HDFS (H5FDperform_init(H5FD_hdfs_init))
0025 
0026 /** Identifier for the hdfs VFD */
0027 #define H5FD_HDFS_VALUE H5_VFD_HDFS
0028 
0029 #else
0030 
0031 /** Initializer for the hdfs VFD (disabled) */
0032 #define H5FD_HDFS       (H5I_INVALID_HID)
0033 
0034 /** Identifier for the hdfs VFD (disabled) */
0035 #define H5FD_HDFS_VALUE H5_VFD_INVALID
0036 
0037 #endif /* H5_HAVE_LIBHDFS */
0038 
0039 #ifdef H5_HAVE_LIBHDFS
0040 #ifdef __cplusplus
0041 extern "C" {
0042 #endif
0043 
0044 /**
0045  * The version number of the H5FD_hdfs_fapl_t configuration
0046  * structure for the #H5FD_HDFS driver
0047  */
0048 #define H5FD__CURR_HDFS_FAPL_T_VERSION 1
0049 
0050 /** Max size of the node name */
0051 #define H5FD__HDFS_NODE_NAME_SPACE 128
0052 /** Max size of the user name */
0053 #define H5FD__HDFS_USER_NAME_SPACE 128
0054 /** Max size of the kerberos cache path */
0055 #define H5FD__HDFS_KERB_CACHE_PATH_SPACE 128
0056 
0057 /**
0058  *\struct H5FD_hdfs_fapl_t
0059  * \brief Configuration structure for H5Pset_fapl_hdfs() / H5Pget_fapl_hdfs()
0060  *
0061  * \details H5FD_hdfs_fapl_t is a public structure that is used to pass
0062  *          configuration data to the #H5FD_HDFS driver via a File Access
0063  *          Property List. A pointer to an instance of this structure is
0064  *          a parameter to H5Pset_fapl_hdfs() and H5Pget_fapl_hdfs().
0065  *
0066  * \var int32_t H5FD_hdfs_fapl_t::version
0067  *      Version number of the H5FD_hdfs_fapl_t structure. Any instance passed
0068  *      to H5Pset_fapl_hdfs() / H5Pget_fapl_hdfs() must have a recognized version
0069  *      number or an error will be raised. Currently, this field should be set
0070  *      to #H5FD__CURR_HDFS_FAPL_T_VERSION.
0071  *
0072  * \var char H5FD_hdfs_fapl_t::namenode_name[H5FD__HDFS_NODE_NAME_SPACE + 1]
0073  *      Name of "Name Node" to access as the HDFS server
0074  *
0075  * \var int32_t H5FD_hdfs_fapl_t::namenode_port
0076  *      Port number to use to connect with Name Node
0077  *
0078  * \var char H5FD_hdfs_fapl_t::user_name[H5FD__HDFS_USER_NAME_SPACE + 1]
0079  *      Username to use when accessing file
0080  *
0081  * \var char H5FD_hdfs_fapl_t::kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1]
0082  *      Path to the location of the Kerberos authentication cache
0083  *
0084  * \var int32_t H5FD_hdfs_fapl_t::stream_buffer_size
0085  *      Size (in bytes) of the file read stream buffer
0086  */
0087 typedef struct H5FD_hdfs_fapl_t {
0088     int32_t version;
0089     char    namenode_name[H5FD__HDFS_NODE_NAME_SPACE + 1];
0090     int32_t namenode_port;
0091     char    user_name[H5FD__HDFS_USER_NAME_SPACE + 1];
0092     char    kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1];
0093     int32_t stream_buffer_size;
0094 } H5FD_hdfs_fapl_t;
0095 
0096 /** @private
0097  *
0098  * \brief Private initializer for the hdfs VFD
0099  */
0100 H5_DLL hid_t H5FD_hdfs_init(void);
0101 
0102 /**
0103  * \ingroup FAPL
0104  *
0105  * \brief Modifies the file access property list to use the #H5FD_HDFS driver
0106  *
0107  * \fapl_id
0108  * \param[in] fa Pointer to #H5FD_HDFS driver configuration structure
0109  *
0110  * \returns \herr_t
0111  *
0112  * \details H5Pset_fapl_hdfs() modifies the file access property list to use the
0113  *          #H5FD_HDFS driver.
0114  *
0115  * \since 1.10.6
0116  */
0117 H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa);
0118 
0119 /**
0120  * \ingroup FAPL
0121  *
0122  * \brief Queries a File Access Property List for #H5FD_HDFS file driver properties
0123  *
0124  * \fapl_id
0125  * \param[out] fa_out Pointer to #H5FD_HDFS driver configuration structure
0126  * \returns \herr_t
0127  *
0128  * \details H5Pget_fapl_hdfs() queries the #H5FD_HDFS driver properties as set
0129  *          by H5Pset_fapl_hdfs().
0130  *
0131  * \since 1.10.6
0132  */
0133 H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out);
0134 
0135 #ifdef __cplusplus
0136 }
0137 #endif
0138 #endif /* H5_HAVE_LIBHDFS */
0139 
0140 #endif /* ifndef H5FDhdfs_H */