diff options
author | Sakshi <sabansal@redhat.com> | 2015-05-28 11:23:55 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-07-03 22:39:17 -0700 |
commit | 1b420a3f695a755c6a45b3b74d28c41f7a2d943b (patch) | |
tree | baf617c90320750c871b948c7cc3f4d9386cb2ac /cli/src | |
parent | d308fb5e152d8c908bf4f5da81f553fbe3d0400a (diff) |
cli: different status output for rebalance fix-layout
Change-Id: I6ded40a1b1cff5c72e5b61fd353db3d8c688efd8
BUG: 1225718
Signed-off-by: Sakshi <sabansal@redhat.com>
Reviewed-on: http://review.gluster.org/10956
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index de3a382869d..25b1ccdd9cd 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1561,13 +1561,32 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type, goto out; } + memset (key, 0, 256); + snprintf (key, 256, "status-1"); + + ret = dict_get_int32 (dict, key, (int32_t *)&status_rcd); + if (ret) { + gf_log ("cli", GF_LOG_TRACE, "count %d %d", count, 1); + gf_log ("cli", GF_LOG_TRACE, "failed to get status"); + goto out; + } + + if (status_rcd >= GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED) { + cli_out ("%10s %40s %18s", "Node", "status", + "run time in h:m:s"); + cli_out ("%10s %40s %18s", "---------", "-----------", + "------------"); + } else { + cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s", + "Node", "Rebalanced-files", "size", "scanned", + "failures", "skipped", "status", "run time in" + " h:m:s"); + cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s", + "---------", "-----------", "-----------", + "-----------", "-----------", "-----------", + "------------", "--------------"); + } - cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s", "Node", - "Rebalanced-files", "size", "scanned", "failures", "skipped", - "status", "run time in h:m:s"); - cli_out ("%40s %16s %13s %13s %13s %13s %20s %18s", "---------", - "-----------", "-----------", "-----------", "-----------", - "-----------", "------------", "--------------"); for (i = 1; i <= count; i++) { /* Reset the variables to prevent carryover of values */ node_name = NULL; @@ -1664,16 +1683,23 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type, min = ((int) elapsed % 3600) / 60; sec = ((int) elapsed % 3600) % 60; - if (size_str) { - cli_out ("%40s %16"PRIu64 " %13s" " %13"PRIu64 " %13" - PRIu64" %13"PRIu64 " %20s %8d:%d:%d", - node_name, files, size_str, lookup, failures, - skipped, status_str, hrs, min, sec); + if (status_rcd >= GF_DEFRAG_STATUS_LAYOUT_FIX_STARTED) { + cli_out ("%10s %40s %8d:%d:%d", node_name, status_str, + hrs, min, sec); } else { - cli_out ("%40s %16"PRIu64 " %13"PRIu64 " %13"PRIu64 - " %13"PRIu64" %13"PRIu64 " %20s %8d:%d:%d", - node_name, files, size, lookup, failures, - skipped, status_str, hrs, min, sec); + if (size_str) { + cli_out ("%40s %16"PRIu64 " %13s" " %13"PRIu64 + " %13" PRIu64" %13"PRIu64 " %20s " + "%8d:%d:%d", node_name, files, + size_str, lookup, failures, skipped, + status_str, hrs, min, sec); + } else { + cli_out ("%40s %16"PRIu64 " %13"PRIu64 " %13" + PRIu64 " %13"PRIu64" %13"PRIu64 " %20s" + " %8d:%d:%d", node_name, files, size, + lookup, failures, skipped, status_str, + hrs, min, sec); + } } GF_FREE(size_str); } |