H5FDhdfs.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. * Copyright by The HDF Group. *
  3. * *
  4. * All rights reserved. *
  5. * *
  6. * This file is part of HDF5. The full HDF5 copyright notice, including *
  7. * terms governing use, modification, and redistribution, is contained in *
  8. * the COPYING file, which can be found at the root of the source code *
  9. * distribution tree, or in https://www.hdfgroup.org/licenses. *
  10. * If you do not have access to either file, you may request a copy from *
  11. * help@hdfgroup.org. *
  12. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  13. /*
  14. * Programmer: Jacob Smith
  15. * 2018-04-23
  16. *
  17. * Purpose: The public header file for the hdfs driver.
  18. */
  19. #ifndef H5FDhdfs_H
  20. #define H5FDhdfs_H
  21. #ifdef H5_HAVE_LIBHDFS
  22. #define H5FD_HDFS (H5FDperform_init(H5FD_hdfs_init))
  23. #define H5FD_HDFS_VALUE H5_VFD_HDFS
  24. #else /* H5_HAVE_LIBHDFS */
  25. #define H5FD_HDFS (H5I_INVALID_HID)
  26. #define H5FD_HDFS_VALUE H5_VFD_INVALID
  27. #endif /* H5_HAVE_LIBHDFS */
  28. #ifdef H5_HAVE_LIBHDFS
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /****************************************************************************
  33. *
  34. * Structure: H5FD_hdfs_fapl_t
  35. *
  36. * Purpose:
  37. *
  38. * H5FD_hdfs_fapl_t is a public structure that is used to pass
  39. * configuration information to the appropriate HDFS VFD via the FAPL.
  40. * A pointer to an instance of this structure is a parameter to
  41. * H5Pset_fapl_hdfs() and H5Pget_fapl_hdfs().
  42. *
  43. *
  44. *
  45. * `version` (int32_t)
  46. *
  47. * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed
  48. * to the above calls must have a recognized version number, or an error
  49. * will be flagged.
  50. *
  51. * This field should be set to `H5FD__CURR_HDFS_FAPL_T_VERSION`.
  52. *
  53. * `namenode_name` (const char[])
  54. *
  55. * Name of "Name Node" to access as the HDFS server.
  56. *
  57. * Must not be longer than `H5FD__HDFS_NODE_NAME_SPACE`.
  58. *
  59. * TBD: Can be NULL.
  60. *
  61. * `namenode_port` (int32_t) TBD
  62. *
  63. * Port number to use to connect with Name Node.
  64. *
  65. * TBD: If 0, uses a default port.
  66. *
  67. * `kerberos_ticket_cache` (const char[])
  68. *
  69. * Path to the location of the Kerberos authentication cache.
  70. *
  71. * Must not be longer than `H5FD__HDFS_KERB_CACHE_PATH_SPACE`.
  72. *
  73. * TBD: Can be NULL.
  74. *
  75. * `user_name` (const char[])
  76. *
  77. * Username to use when accessing file.
  78. *
  79. * Must not be longer than `H5FD__HDFS_USER_NAME_SPACE`.
  80. *
  81. * TBD: Can be NULL.
  82. *
  83. * `stream_buffer_size` (int32_t)
  84. *
  85. * Size (in bytes) of the file read stream buffer.
  86. *
  87. * TBD: If -1, relies on a default value.
  88. *
  89. *
  90. *
  91. * Programmer: Jacob Smith
  92. * 2018-04-23
  93. *
  94. ****************************************************************************/
  95. #define H5FD__CURR_HDFS_FAPL_T_VERSION 1
  96. #define H5FD__HDFS_NODE_NAME_SPACE 128
  97. #define H5FD__HDFS_USER_NAME_SPACE 128
  98. #define H5FD__HDFS_KERB_CACHE_PATH_SPACE 128
  99. typedef struct H5FD_hdfs_fapl_t {
  100. int32_t version;
  101. char namenode_name[H5FD__HDFS_NODE_NAME_SPACE + 1];
  102. int32_t namenode_port;
  103. char user_name[H5FD__HDFS_USER_NAME_SPACE + 1];
  104. char kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1];
  105. int32_t stream_buffer_size;
  106. } H5FD_hdfs_fapl_t;
  107. H5_DLL hid_t H5FD_hdfs_init(void);
  108. /**
  109. * \ingroup FAPL
  110. *
  111. * \todo Add missing documentation
  112. */
  113. H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out);
  114. /**
  115. * \ingroup FAPL
  116. *
  117. * \todo Add missing documentation
  118. */
  119. H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa);
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123. #endif /* H5_HAVE_LIBHDFS */
  124. #endif /* ifndef H5FDhdfs_H */