From c94f5bdf309f024c30cc4796b528edb1e1b4a48b Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Tue, 15 Sep 2015 11:07:03 +0530 Subject: Tier/cli: tier related information in volume status command back port of : http://review.gluster.org/#/c/12176/ 0 0 v1 5 10.70.42.203 /data/gluster/tier/hbr1 137e2a4f-2bde-4a97-b3f3-470a2e092155 1 49154 49154 N/A 6535 10.70.42.203 /data/gluster/tier/cb1 137e2a4f-2bde-4a97-b3f3-470a2e092155 1 49152 49152 N/A 6530 NFS Server 10.70.42.203 137e2a4f-2bde-4a97-b3f3-470a2e092155 1 2049 2049 N/A 6519 Rebalance 8da729f2-f1b2-4f55-9945-472130be93f7 4 failed >Change-Id: Idfdbce47d03ee2cdbf407c57159fd37a2900ad2c >BUG: 1263100 >Signed-off-by: hari gowtham >Reviewed-on: http://review.gluster.org/12176 >Tested-by: NetBSD Build System >Reviewed-by: Dan Lambright >Tested-by: Dan Lambright Change-Id: Idfdbce47d03ee2cdbf407c57159fd37a2900ad2c BUG: 1258347 Signed-off-by: Hari Gowtham Reviewed-on: http://review.gluster.org/12200 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- cli/src/cli-xml-output.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 327cd6c6ffd..3ad7250397b 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -1620,7 +1620,8 @@ cli_xml_output_vol_status (cli_local_t *local, dict_t *dict) int online = 0; gf_boolean_t node_present = _gf_true; int i; - + int type = -1; + int hot_brick_count = -1; /* */ ret = xmlTextWriterStartElement (local->writer, (xmlChar *)"volume"); @@ -1656,7 +1657,28 @@ cli_xml_output_vol_status (cli_local_t *local, dict_t *dict) index_max = brick_index_max + other_count; + ret = dict_get_int32 (dict, "type", &type); + if (ret) + goto out; + + if (type == GF_CLUSTER_TYPE_TIER) { + ret = dict_get_int32 (dict, "hot_brick_count", + &hot_brick_count); + if (ret) + goto out; + + ret = xmlTextWriterStartElement + (local->writer, (xmlChar *)"hotBrick"); + XML_RET_CHECK_AND_GOTO (ret, out); + + } for (i = 0; i <= index_max; i++) { + + if (type == GF_CLUSTER_TYPE_TIER && i >= hot_brick_count) { + ret = xmlTextWriterStartElement (local->writer, + (xmlChar *)"coldBrick"); + XML_RET_CHECK_AND_GOTO (ret, out); + } ret = cli_xml_output_vol_status_common (local->writer, dict, i, &online, &node_present); if (ret) { @@ -1726,8 +1748,18 @@ cli_xml_output_vol_status (cli_local_t *local, dict_t *dict) /* was opened in cli_xml_output_vol_status_common()*/ ret = xmlTextWriterEndElement (local->writer); XML_RET_CHECK_AND_GOTO (ret, out); + + if (type == GF_CLUSTER_TYPE_TIER && i < hot_brick_count) { + ret = xmlTextWriterEndElement (local->writer); + XML_RET_CHECK_AND_GOTO (ret, out); + } + if (type == GF_CLUSTER_TYPE_TIER && i >= hot_brick_count) { + ret = xmlTextWriterEndElement (local->writer); + XML_RET_CHECK_AND_GOTO (ret, out); + } } + /* Tasks are only present when a normal volume status call is done on a * single volume or on all volumes */ -- cgit