diff options
| author | Aravinda VK <avishwan@redhat.com> | 2015-03-12 16:07:13 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-05 02:15:24 -0700 | 
| commit | 98b69412e92742e0638ef8bd76223671386f5a39 (patch) | |
| tree | 4d02c8989c50c7b219404900bc7beac327b19dca /cli/src/cli-xml-output.c | |
| parent | e02ac3c28241ff004d6cfbfc03975822146ce5dd (diff) | |
geo-rep: Status Enhancements
Discussion in gluster-devel
http://www.gluster.org/pipermail/gluster-devel/2015-April/044301.html
MASTER NODE - Master Volume Node
MASTER VOL - Master Volume name
MASTER BRICK - Master Volume Brick
SLAVE USER - Slave User to which Geo-rep session is established
SLAVE - <SLAVE_NODE>::<SLAVE_VOL> used in Geo-rep Create command
SLAVE NODE - Slave Node to which Master worker is connected
STATUS - Worker Status(Created, Initializing, Active, Passive, Faulty,
         Paused, Stopped)
CRAWL STATUS - Crawl type(Hybrid Crawl, History Crawl, Changelog Crawl)
LAST_SYNCED - Last Synced Time(Local Time in CLI output and UTC in XML output)
ENTRY - Number of entry Operations pending.(Resets on worker restart)
DATA - Number of Data operations pending(Resets on worker restart)
META - Number of Meta operations pending(Resets on worker restart)
FAILURES - Number of Failures
CHECKPOINT TIME - Checkpoint set Time(Local Time in CLI output and UTC
                  in XML output)
CHECKPOINT COMPLETED - Yes/No or N/A
CHECKPOINT COMPLETION TIME - Checkpoint Completed Time(Local Time in CLI
                             output and UTC in XML output)
XML output:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
cliOutput>
  geoRep>
      volume>
        name>
        sessions>
          session>
             session_slave>
             pair>
                master_node>
                master_brick>
                slave_user>
                slave/>
                slave_node>
                status>
                crawl_status>
                entry>
                data>
                meta>
                failures>
                checkpoint_completed>
                master_node_uuid>
                last_synced>
                checkpoint_time>
                checkpoint_completion_time>
BUG: 1212410
Change-Id: I944a6c3c67f1e6d6baf9670b474233bec8f61ea3
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/10121
Tested-by: NetBSD Build System
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli/src/cli-xml-output.c')
| -rw-r--r-- | cli/src/cli-xml-output.c | 68 | 
1 files changed, 27 insertions, 41 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index cbb4c1f58e7..d7322d5bb0d 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -3839,25 +3839,6 @@ out:  #if (HAVE_LIB_XML)  int -gf_gsync_status_t_comparator (const void *p, const void *q) -{ -        char *master1 = NULL; -        char *master2 = NULL; - -        master1 = get_struct_variable (1, (*(gf_gsync_status_t **)p)); -        master2 = get_struct_variable (1, (*(gf_gsync_status_t **)q)); -        if (!master1 || !master2) { -                gf_log ("cli", GF_LOG_ERROR, -                        "struct member empty."); -                return 0; -        } - -        return strcmp (master1,master2); -} -#endif - -#if (HAVE_LIB_XML) -int  cli_xml_output_vol_gsync_status (dict_t *dict,                                   xmlTextWriterPtr writer)  { @@ -3865,8 +3846,7 @@ cli_xml_output_vol_gsync_status (dict_t *dict,          int                  i                           = 1;          int                  j                           = 0;          int                  count                       = 0; -        const int            number_of_fields            = 13; -        const int            number_of_basic_fields      = 8; +        const int            number_of_fields            = 20;          int                  closed                      = 1;          int                  session_closed              = 1;          gf_gsync_status_t  **status_values               = NULL; @@ -3878,18 +3858,31 @@ cli_xml_output_vol_gsync_status (dict_t *dict,          char                *slave                       = NULL;          char                *slave_next                  = NULL;          char                *title_values[]              = {"master_node", -                                                            "master_node_uuid", +                                                            "",                                                              "master_brick",                                                              "slave_user",                                                              "slave", +                                                            "slave_node",                                                              "status", -                                                            "checkpoint_status",                                                              "crawl_status", -                                                            "files_syncd", -                                                            "files_pending", -                                                            "bytes_pending", -                                                            "deletes_pending", -                                                            "files_skipped"}; +                                                            /* last_synced */ +                                                            "", +                                                            "entry", +                                                            "data", +                                                            "meta", +                                                            "failures", +                                                           /* checkpoint_time */ +                                                            "", +                                                         "checkpoint_completed", +                                               /* checkpoint_completion_time */ +                                                            "", +                                                            "master_node_uuid", +                                                           /* last_synced_utc */ +                                                            "last_synced", +                                                       /* checkpoint_time_utc */ +                                                            "checkpoint_time", +                                            /* checkpoint_completion_time_utc */ +                                                 "checkpoint_completion_time"};          GF_ASSERT (dict); @@ -3963,7 +3956,7 @@ cli_xml_output_vol_gsync_status (dict_t *dict,                          session_closed = 0; -                        tmp = get_struct_variable (15, status_values[i]); +                        tmp = get_struct_variable (21, status_values[i]);                          if (!tmp) {                                  gf_log ("cli", GF_LOG_ERROR,                                          "struct member empty."); @@ -3980,18 +3973,11 @@ cli_xml_output_vol_gsync_status (dict_t *dict,                  XML_RET_CHECK_AND_GOTO (ret, out);                  for (j = 0; j < number_of_fields; j++) { -                  // if detail option is not set and field is not under -                  // basic fields or if field is volume then skip -                        if(!status_detail && j >= number_of_basic_fields) +                        /* XML ignore fields */ +                        if (strcmp(title_values[j], "") == 0)                                  continue; -                        // Displaying the master_node uuid as second field - -                        if (j == 1) -                                tmp = get_struct_variable (13, -                                                           status_values[i]); -                        else -                                tmp = get_struct_variable (j, status_values[i]); +                        tmp = get_struct_variable (j, status_values[i]);                          if (!tmp) {                                  gf_log ("cli", GF_LOG_ERROR,                                          "struct member empty."); @@ -4009,8 +3995,8 @@ cli_xml_output_vol_gsync_status (dict_t *dict,                  XML_RET_CHECK_AND_GOTO (ret, out);                  if (i+1 < count) { -                        slave = get_struct_variable (14, status_values[i]); -                        slave_next = get_struct_variable (14, +                        slave = get_struct_variable (20, status_values[i]); +                        slave_next = get_struct_variable (20,                                                            status_values[i+1]);                          volume = get_struct_variable (1, status_values[i]);                          volume_next = get_struct_variable (1,  | 
