home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / include / pvfs2-mgmt.h < prev    next >
C/C++ Source or Header  |  2010-04-30  |  11KB  |  429 lines

  1. /*
  2.  * (C) 2001 Clemson University and The University of Chicago
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6. /* NOTE: if you make any changes to the encoding definitions in this file,
  7.  * please update the PVFS2_PROTO_VERSION in pvfs2-req-proto.h accordingly
  8.  */
  9.  
  10. /** \defgroup mgmtint PVFS2 management interface
  11.  *
  12.  *  The PVFS2 management interface provides functionality used to check
  13.  *  file system status and to repair damaged file systems.  Both blocking
  14.  *  and nonblocking calls are provided for most operations.
  15.  *
  16.  * @{
  17.  */
  18.  
  19. /** \file
  20.  *  Declarations for the PVFS2 management interface.
  21.  */
  22.  
  23. #ifndef __PVFS2_MGMT_H
  24. #define __PVFS2_MGMT_H
  25.  
  26. #include "pvfs2-sysint.h"
  27. #include "pvfs2-types.h"
  28.  
  29. /* non-blocking mgmt operation handle */
  30. typedef PVFS_id_gen_t PVFS_mgmt_op_id;
  31.  
  32. /* low level statfs style information for each server */
  33. /* see PVFS_mgmt_statfs_all() */
  34. struct PVFS_mgmt_server_stat 
  35. {
  36.     PVFS_fs_id fs_id;
  37.     PVFS_size bytes_available;
  38.     PVFS_size bytes_total;
  39.     uint64_t ram_total_bytes;
  40.     uint64_t ram_free_bytes;
  41.     uint64_t load_1;
  42.     uint64_t load_5;
  43.     uint64_t load_15;
  44.     uint64_t uptime_seconds;
  45.     uint64_t handles_available_count;
  46.     uint64_t handles_total_count;
  47.     const char* bmi_address;
  48.     int server_type;
  49. };
  50.  
  51. /* performance monitoring statistics */
  52. struct PVFS_mgmt_perf_stat
  53. {
  54.     int32_t valid_flag;        /* is this entry valid? */
  55.     uint32_t id;        /* timestep id */
  56.     uint64_t start_time_ms; /* start time of perf set, ms since epoch */
  57.     int64_t write;        /* bytes written */
  58.     int64_t read;        /* bytes read */
  59.     int64_t metadata_write; /* # of modifying metadata ops */
  60.     int64_t metadata_read;  /* # of non-modifying metadata ops */
  61.     int32_t dspace_queue;   /* # of metadata dspace ops in the queue */
  62.     int32_t keyval_queue;   /* # of metadata keyval ops in the queue */
  63.     int32_t reqsched;       /* # of currently scheduled request posted */
  64. };
  65. endecode_fields_11_struct(
  66.     PVFS_mgmt_perf_stat,
  67.     int32_t, valid_flag,
  68.     uint32_t, id,
  69.     uint64_t, start_time_ms,
  70.     int64_t, write,
  71.     int64_t, read,
  72.     int64_t, metadata_write,
  73.     int64_t, metadata_read,
  74.     int32_t, dspace_queue,
  75.     int32_t, keyval_queue,
  76.     int32_t, reqsched,
  77.     skip4,);
  78.  
  79. /* low level information about individual server level objects */
  80. struct PVFS_mgmt_dspace_info
  81. {
  82.     PVFS_error error_code;    /* error code for this query */
  83.     PVFS_handle handle;        /* handle this struct refers to */
  84.     PVFS_ds_type type;        /* type of object */
  85.     PVFS_size b_size;        /* size of bstream (if applicable) */
  86.     PVFS_handle dirdata_handle; /* directory data handle (if applicable) */
  87. };
  88. endecode_fields_7_struct(
  89.   PVFS_mgmt_dspace_info,
  90.   PVFS_error, error_code,
  91.   skip4,,
  92.   PVFS_handle, handle,
  93.   PVFS_ds_type, type,
  94.   skip4,,
  95.   PVFS_size, b_size,
  96.   PVFS_handle, dirdata_handle);
  97.  
  98. /* individual datapoint from event monitoring */
  99. struct PVFS_mgmt_event
  100. {
  101.     int32_t api;
  102.     int32_t operation;
  103.     int64_t value;
  104.     PVFS_id_gen_t id;
  105.     int32_t flags;
  106.     int32_t tv_sec;
  107.     int32_t tv_usec;
  108. };
  109. endecode_fields_8_struct(
  110.     PVFS_mgmt_event,
  111.     int32_t, api,
  112.     int32_t, operation,
  113.     int64_t, value,
  114.     PVFS_id_gen_t, id,
  115.     int32_t, flags,
  116.     int32_t, tv_sec,
  117.     int32_t, tv_usec,
  118.     skip4,);
  119.  
  120. /* values which may be or'd together in the flags field above */
  121. enum
  122. {
  123.     PVFS_MGMT_IO_SERVER = 1,
  124.     PVFS_MGMT_META_SERVER = 2
  125. };
  126.  
  127. PVFS_error PVFS_mgmt_count_servers(
  128.     PVFS_fs_id fs_id,
  129.     PVFS_credentials *credentials,
  130.     int server_type,
  131.     int *count);
  132.  
  133. PVFS_error PVFS_mgmt_get_server_array(
  134.     PVFS_fs_id fs_id,
  135.     PVFS_credentials *credentials,
  136.     int server_type,
  137.     PVFS_BMI_addr_t *addr_array,
  138.     int *inout_count_p);
  139.  
  140. PVFS_error PVFS_imgmt_noop(
  141.     PVFS_fs_id fs_id,
  142.     PVFS_credentials *credentials,
  143.     PVFS_BMI_addr_t addr,
  144.     PVFS_mgmt_op_id *op_id,
  145.     PVFS_hint hints,
  146.     void *user_ptr);
  147.  
  148. PVFS_error PVFS_mgmt_noop(
  149.     PVFS_fs_id,
  150.     PVFS_credentials *credentials,
  151.     PVFS_BMI_addr_t addr,
  152.     PVFS_hint hints);
  153.  
  154. const char* PVFS_mgmt_map_addr(
  155.     PVFS_fs_id fs_id,
  156.     PVFS_credentials *credentials,
  157.     PVFS_BMI_addr_t addr,
  158.     int* server_type);
  159.  
  160. PVFS_error PVFS_imgmt_setparam_list(
  161.     PVFS_fs_id fs_id,
  162.     PVFS_credentials *credentials,
  163.     enum PVFS_server_param param,
  164.     struct PVFS_mgmt_setparam_value *value,
  165.     PVFS_BMI_addr_t *addr_array,
  166.     int count,
  167.     PVFS_error_details *details,
  168.     PVFS_hint hints,
  169.     PVFS_mgmt_op_id *op_id,
  170.     void *user_ptr);
  171.  
  172. PVFS_error PVFS_mgmt_setparam_list(
  173.     PVFS_fs_id fs_id,
  174.     PVFS_credentials *credentials,
  175.     enum PVFS_server_param param,
  176.     struct PVFS_mgmt_setparam_value *value,
  177.     PVFS_BMI_addr_t *addr_array,
  178.     int count,
  179.     PVFS_error_details *details,
  180.     PVFS_hint hints);
  181.  
  182. PVFS_error PVFS_mgmt_setparam_all(
  183.     PVFS_fs_id fs_id,
  184.     PVFS_credentials *credentials,
  185.     enum PVFS_server_param param,
  186.     struct PVFS_mgmt_setparam_value *value,
  187.     PVFS_error_details *details,
  188.     PVFS_hint hints);
  189.  
  190. PVFS_error PVFS_mgmt_setparam_single(
  191.     PVFS_fs_id fs_id,
  192.     PVFS_credentials *credentials,
  193.     enum PVFS_server_param param,
  194.     struct PVFS_mgmt_setparam_value *value,
  195.     char *server_addr_str,
  196.     PVFS_error_details *details,
  197.     PVFS_hint hints);
  198.  
  199. PVFS_error PVFS_imgmt_statfs_list(
  200.     PVFS_fs_id fs_id,
  201.     PVFS_credentials *credentials,
  202.     struct PVFS_mgmt_server_stat *stat_array,
  203.     PVFS_BMI_addr_t *addr_array,
  204.     int count,
  205.     PVFS_error_details *details,
  206.     PVFS_mgmt_op_id *op_id,
  207.     PVFS_hint hints,
  208.     void *user_ptr);
  209.  
  210. PVFS_error PVFS_mgmt_statfs_list(
  211.     PVFS_fs_id fs_id,
  212.     PVFS_credentials *credentials,
  213.     struct PVFS_mgmt_server_stat *stat_array,
  214.     PVFS_BMI_addr_t *addr_array,
  215.     int count,
  216.     PVFS_error_details *details,
  217.     PVFS_hint hints);
  218.  
  219. PVFS_error PVFS_mgmt_statfs_all(
  220.     PVFS_fs_id fs_id,
  221.     PVFS_credentials *credentials,
  222.     struct PVFS_mgmt_server_stat *stat_array,
  223.     int *inout_count_p,
  224.     PVFS_error_details *details,
  225.     PVFS_hint hints);
  226.  
  227. PVFS_error PVFS_imgmt_perf_mon_list(
  228.     PVFS_fs_id fs_id,
  229.     PVFS_credentials *credentials,
  230.     struct PVFS_mgmt_perf_stat **perf_matrix,
  231.     uint64_t *end_time_ms_array,
  232.     PVFS_BMI_addr_t *addr_array,
  233.     uint32_t* next_id_array,
  234.     int server_count,
  235.     int history_count,
  236.     PVFS_error_details *details,
  237.     PVFS_mgmt_op_id *op_id,
  238.     PVFS_hint hints,
  239.     void *user_ptr);
  240.  
  241. PVFS_error PVFS_mgmt_perf_mon_list(
  242.     PVFS_fs_id fs_id,
  243.     PVFS_credentials *credentials,
  244.     struct PVFS_mgmt_perf_stat** perf_matrix,
  245.     uint64_t *end_time_ms_array,
  246.     PVFS_BMI_addr_t *addr_array,
  247.     uint32_t *next_id_array,
  248.     int server_count,
  249.     int history_count,
  250.     PVFS_error_details *details,
  251.     PVFS_hint hints);
  252.  
  253. PVFS_error PVFS_imgmt_event_mon_list(
  254.     PVFS_fs_id fs_id,
  255.     PVFS_credentials *credentials,
  256.     struct PVFS_mgmt_event** event_matrix,
  257.     PVFS_BMI_addr_t *addr_array,
  258.     int server_count,
  259.     int event_count,
  260.     PVFS_error_details *details,
  261.     PVFS_mgmt_op_id *op_id,
  262.     PVFS_hint hints,
  263.     void *user_ptr);
  264.  
  265. PVFS_error PVFS_mgmt_event_mon_list(
  266.     PVFS_fs_id fs_id,
  267.     PVFS_credentials *credentials,
  268.     struct PVFS_mgmt_event **event_matrix,
  269.     PVFS_BMI_addr_t *addr_array,
  270.     int server_count,
  271.     int event_count,
  272.     PVFS_error_details *details,
  273.     PVFS_hint hints);
  274.  
  275.  
  276. PVFS_error PVFS_imgmt_iterate_handles_list(
  277.     PVFS_fs_id fs_id,
  278.     PVFS_credentials *credentials,
  279.     PVFS_handle **handle_matrix,
  280.     int *handle_count_array,
  281.     PVFS_ds_position *position_array,
  282.     PVFS_BMI_addr_t *addr_array,
  283.     int server_count,
  284.     int flags,
  285.     PVFS_error_details *details,
  286.     PVFS_hint hints,
  287.     PVFS_mgmt_op_id *op_id,
  288.     void *user_ptr);
  289.  
  290. PVFS_error PVFS_mgmt_iterate_handles_list(
  291.     PVFS_fs_id fs_id,
  292.     PVFS_credentials *credentials,
  293.     PVFS_handle **handle_matrix,
  294.     int *handle_count_array,
  295.     PVFS_ds_position *position_array,
  296.     PVFS_BMI_addr_t *addr_array,
  297.     int server_count,
  298.     int flags,
  299.     PVFS_error_details *details,
  300.     PVFS_hint hints);
  301.  
  302. PVFS_error PVFS_imgmt_get_dfile_array(
  303.     PVFS_object_ref ref,
  304.     PVFS_credentials *credentials,
  305.     PVFS_handle *dfile_array,
  306.     int dfile_count,
  307.     PVFS_mgmt_op_id *op_id,
  308.     PVFS_hint hints,
  309.     void *user_ptr);
  310.  
  311. PVFS_error PVFS_mgmt_get_dfile_array(
  312.     PVFS_object_ref ref,
  313.     PVFS_credentials *credentials,
  314.     PVFS_handle *dfile_array,
  315.     int dfile_count,
  316.     PVFS_hint hints);
  317.  
  318. PVFS_error PVFS_imgmt_remove_object(
  319.     PVFS_object_ref object_ref,
  320.     PVFS_credentials *credentials,
  321.     PVFS_mgmt_op_id *op_id,
  322.     PVFS_hint hints,
  323.     void *user_ptr);
  324.  
  325. PVFS_error PVFS_mgmt_remove_object(
  326.     PVFS_object_ref object_ref,
  327.     PVFS_credentials *credentials,
  328.     PVFS_hint hints);
  329.  
  330. PVFS_error PVFS_imgmt_remove_dirent(
  331.     PVFS_object_ref parent_ref,
  332.     char *entry,
  333.     PVFS_credentials *credentials,
  334.     PVFS_mgmt_op_id *op_id,
  335.     PVFS_hint hints,
  336.     void *user_ptr);
  337.  
  338. PVFS_error PVFS_mgmt_remove_dirent(
  339.     PVFS_object_ref parent_ref,
  340.     char *entry,
  341.     PVFS_credentials *credentials,
  342.     PVFS_hint hints);
  343.  
  344. PVFS_error PVFS_imgmt_create_dirent(
  345.     PVFS_object_ref parent_ref,
  346.     char *entry,
  347.     PVFS_handle entry_handle,
  348.     PVFS_credentials *credentials,
  349.     PVFS_mgmt_op_id *op_id,
  350.     PVFS_hint hints,
  351.     void *user_ptr);
  352.  
  353. PVFS_error PVFS_mgmt_create_dirent(
  354.     PVFS_object_ref parent_ref,
  355.     char *entry,
  356.     PVFS_handle entry_handle,
  357.     PVFS_credentials *credentials,
  358.     PVFS_hint hints);
  359.  
  360. PVFS_error PVFS_imgmt_get_dirdata_handle(
  361.     PVFS_object_ref parent_ref,
  362.     PVFS_handle *out_dirdata_handle,
  363.     PVFS_credentials *credentials,
  364.     PVFS_mgmt_op_id *op_id,
  365.     PVFS_hint hints,
  366.     void *user_ptr);
  367.  
  368. PVFS_error PVFS_mgmt_get_dirdata_handle(
  369.     PVFS_object_ref parent_ref,
  370.     PVFS_handle *out_dirdata_handle,
  371.     PVFS_credentials *credentials,
  372.     PVFS_hint hints);
  373.  
  374. int PVFS_mgmt_wait(
  375.     PVFS_mgmt_op_id op_id,
  376.     const char *in_op_str,
  377.     int *out_error);
  378.  
  379. int PVFS_mgmt_testsome(
  380.     PVFS_mgmt_op_id *op_id_array,
  381.     int *op_count, /* in/out */
  382.     void **user_ptr_array,
  383.     int *error_code_array,
  384.     int timeout_ms);
  385.  
  386. int PVFS_mgmt_cancel(PVFS_mgmt_op_id op_id);
  387.  
  388. PVFS_error PVFS_imgmt_repair_file(
  389.     char *object_name,
  390.     PVFS_object_ref parent_ref,
  391.     PVFS_sys_attr attr,
  392.     PVFS_credentials *credentials,
  393.     PVFS_handle handle,
  394.     PVFS_sysresp_create *resp,
  395.     PVFS_sys_op_id *op_id,
  396.     void *user_ptr);
  397.  
  398. PVFS_error PVFS_mgmt_repair_file(
  399.     char *object_name,
  400.     PVFS_object_ref parent_ref,
  401.     PVFS_sys_attr attr,
  402.     PVFS_credentials *credentials,
  403.     PVFS_handle handle,
  404.     PVFS_sysresp_create *resp);
  405.                         
  406. int PVFS_mgmt_get_config(
  407.     const PVFS_fs_id* fsid,
  408.     PVFS_BMI_addr_t* addr,
  409.     char* fs_buf,
  410.     int fs_buf_size);
  411.  
  412. PVFS_error PVFS_mgmt_map_handle(
  413.     PVFS_fs_id fs_id,
  414.     PVFS_handle handle,
  415.     PVFS_BMI_addr_t *addr);
  416.  
  417. #endif /* __PVFS2_MGMT_H */
  418.  
  419. /* @} */
  420.  
  421. /*
  422.  * Local variables:
  423.  *  c-indent-level: 4
  424.  *  c-basic-offset: 4
  425.  * End:
  426.  *
  427.  * vim: ts=8 sts=4 sw=4 expandtab
  428.  */
  429.