qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject qpid-dispatch git commit: DISPATCH-579 - Added software version to the router entity.
Date Tue, 29 Nov 2016 15:14:42 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master cb0a14ba2 -> 4ca0d809e


DISPATCH-579 - Added software version to the router entity.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/4ca0d809
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/4ca0d809
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/4ca0d809

Branch: refs/heads/master
Commit: 4ca0d809e5f96eaf202ae6131dd23a184d694db5
Parents: cb0a14b
Author: Ted Ross <tross@redhat.com>
Authored: Tue Nov 29 10:13:55 2016 -0500
Committer: Ted Ross <tross@redhat.com>
Committed: Tue Nov 29 10:13:55 2016 -0500

----------------------------------------------------------------------
 python/qpid_dispatch/management/qdrouter.json |   4 +
 src/router_core/agent_router.c                | 156 +++++++++++----------
 src/router_core/agent_router.h                |   2 +-
 tools/qdstat                                  |   1 +
 4 files changed, 88 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4ca0d809/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index 741ad0f..64c9131 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -393,6 +393,10 @@
                     "description": "Unused placeholder.",
                     "default": 0
                 },
+                "version": {
+                    "type": "string",
+                    "description": "Software Version"
+                },
                 "helloInterval": {
                     "type": "integer",
                     "default": 1,

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4ca0d809/src/router_core/agent_router.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent_router.c b/src/router_core/agent_router.c
index bb84711..d1d3996 100644
--- a/src/router_core/agent_router.c
+++ b/src/router_core/agent_router.c
@@ -18,31 +18,34 @@
  */
 
 #include "agent_router.h"
+#include "config.h"
 #include <inttypes.h>
 #include <stdio.h>
+
 #define QDR_ROUTER_NAME                   0
 #define QDR_ROUTER_IDENTITY               1
 #define QDR_ROUTER_ID                     2
 #define QDR_ROUTER_TYPE                   3
 #define QDR_ROUTER_MODE                   4
 #define QDR_ROUTER_AREA                   5
-#define QDR_ROUTER_HELLO_INTERVAL         6
-#define QDR_ROUTER_HELLO_MAX_AGE          7
-#define QDR_ROUTER_RA_INTERVAL            8
-#define QDR_ROUTER_RA_INTERVAL_FLUX       9
-#define QDR_ROUTER_REMOTE_LS_MAX_AGE      10
-#define QDR_ROUTER_ADDR_COUNT             11
-#define QDR_ROUTER_LINK_COUNT             12
-#define QDR_ROUTER_NODE_COUNT             13
-#define QDR_ROUTER_LINK_ROUTE_COUNT       14
-#define QDR_ROUTER_AUTO_LINK_COUNT        15
-#define QDR_ROUTER_WORKER_THREADS         16
-#define QDR_ROUTER_DEBUG_DUMP             17
-#define QDR_ROUTER_SASL_CONFIG_PATH       18
-#define QDR_ROUTER_SASL_CONFIG_NAME       19
-#define QDR_ROUTER_ROUTER_ID              20
-#define QDR_ROUTER_MOBILE_ADDR_MAX_AGE    21
-#define QDR_ROUTER_CONNECTION_COUNT       22
+#define QDR_ROUTER_VERSION                6
+#define QDR_ROUTER_HELLO_INTERVAL         7
+#define QDR_ROUTER_HELLO_MAX_AGE          8
+#define QDR_ROUTER_RA_INTERVAL            9
+#define QDR_ROUTER_RA_INTERVAL_FLUX       10
+#define QDR_ROUTER_REMOTE_LS_MAX_AGE      11
+#define QDR_ROUTER_ADDR_COUNT             12
+#define QDR_ROUTER_LINK_COUNT             13
+#define QDR_ROUTER_NODE_COUNT             14
+#define QDR_ROUTER_LINK_ROUTE_COUNT       15
+#define QDR_ROUTER_AUTO_LINK_COUNT        16
+#define QDR_ROUTER_WORKER_THREADS         17
+#define QDR_ROUTER_DEBUG_DUMP             18
+#define QDR_ROUTER_SASL_CONFIG_PATH       19
+#define QDR_ROUTER_SASL_CONFIG_NAME       20
+#define QDR_ROUTER_ROUTER_ID              21
+#define QDR_ROUTER_MOBILE_ADDR_MAX_AGE    22
+#define QDR_ROUTER_CONNECTION_COUNT       23
 
 const char *qdr_router_columns[] =
     {"name",
@@ -51,6 +54,7 @@ const char *qdr_router_columns[] =
      "type",
      "mode",
      "area",
+     "version",
      "helloInterval",
      "helloMaxAge",
      "raInterval",
@@ -88,65 +92,69 @@ static void qdr_agent_write_column_CT(qd_composed_field_t *body, int col,
qdr_co
 {
 
     switch(col) {
-        case QDR_ROUTER_IDENTITY:
-            // There is only one instance of router. Just give it an identity of 1
-            qd_compose_insert_string(body, "1");
-            break;
-        case QDR_ROUTER_TYPE:
-            qd_compose_insert_string(body, "org.apache.qpid.dispatch.router");
-            break;
-
-        case QDR_ROUTER_MODE:
-            qd_compose_insert_string(body, router_mode(core->router_mode));
-            break;
-
-        case QDR_ROUTER_AREA:
-            if (core->router_area)
-                qd_compose_insert_string(body, core->router_area);
-            else
-                qd_compose_insert_null(body);
-            break;
-
-        case QDR_ROUTER_HELLO_INTERVAL:
+    case QDR_ROUTER_IDENTITY:
+        // There is only one instance of router. Just give it an identity of 1
+        qd_compose_insert_string(body, "1");
+        break;
+    case QDR_ROUTER_TYPE:
+        qd_compose_insert_string(body, "org.apache.qpid.dispatch.router");
+        break;
+
+    case QDR_ROUTER_MODE:
+        qd_compose_insert_string(body, router_mode(core->router_mode));
+        break;
+
+    case QDR_ROUTER_AREA:
+        if (core->router_area)
+            qd_compose_insert_string(body, core->router_area);
+        else
             qd_compose_insert_null(body);
-            break;
-
-        case QDR_ROUTER_ADDR_COUNT:
-            qd_compose_insert_ulong(body, DEQ_SIZE(core->addrs));
-            break;
-
-        case QDR_ROUTER_LINK_COUNT:
-            qd_compose_insert_ulong(body, DEQ_SIZE(core->open_links));
-            break;
-
-        case QDR_ROUTER_NODE_COUNT:
-            qd_compose_insert_ulong(body, DEQ_SIZE(core->routers));
-            break;
-
-        case QDR_ROUTER_CONNECTION_COUNT:
-            qd_compose_insert_ulong(body, DEQ_SIZE(core->open_connections));
-            break;
-
-        case QDR_ROUTER_LINK_ROUTE_COUNT:
-            qd_compose_insert_ulong(body, DEQ_SIZE(core->link_routes));
-            break;
-
-        case QDR_ROUTER_AUTO_LINK_COUNT:
-            qd_compose_insert_ulong(body, DEQ_SIZE(core->auto_links));
-            break;
-
-        case QDR_ROUTER_ROUTER_ID:
-        case QDR_ROUTER_ID:
-        case QDR_ROUTER_NAME:
-            if (core->router_id)
-                qd_compose_insert_string(body, core->router_id);
-            else
-                qd_compose_insert_null(body);
-            break;
-
-        default:
+        break;
+
+    case QDR_ROUTER_VERSION:
+        qd_compose_insert_string(body, QPID_DISPATCH_VERSION);
+        break;
+
+    case QDR_ROUTER_HELLO_INTERVAL:
+        qd_compose_insert_null(body);
+        break;
+
+    case QDR_ROUTER_ADDR_COUNT:
+        qd_compose_insert_ulong(body, DEQ_SIZE(core->addrs));
+        break;
+
+    case QDR_ROUTER_LINK_COUNT:
+        qd_compose_insert_ulong(body, DEQ_SIZE(core->open_links));
+        break;
+
+    case QDR_ROUTER_NODE_COUNT:
+        qd_compose_insert_ulong(body, DEQ_SIZE(core->routers));
+        break;
+
+    case QDR_ROUTER_CONNECTION_COUNT:
+        qd_compose_insert_ulong(body, DEQ_SIZE(core->open_connections));
+        break;
+
+    case QDR_ROUTER_LINK_ROUTE_COUNT:
+        qd_compose_insert_ulong(body, DEQ_SIZE(core->link_routes));
+        break;
+
+    case QDR_ROUTER_AUTO_LINK_COUNT:
+        qd_compose_insert_ulong(body, DEQ_SIZE(core->auto_links));
+        break;
+
+    case QDR_ROUTER_ROUTER_ID:
+    case QDR_ROUTER_ID:
+    case QDR_ROUTER_NAME:
+        if (core->router_id)
+            qd_compose_insert_string(body, core->router_id);
+        else
             qd_compose_insert_null(body);
-            break;
+        break;
+
+    default:
+        qd_compose_insert_null(body);
+        break;
     }
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4ca0d809/src/router_core/agent_router.h
----------------------------------------------------------------------
diff --git a/src/router_core/agent_router.h b/src/router_core/agent_router.h
index b2738f3..dffc0eb 100644
--- a/src/router_core/agent_router.h
+++ b/src/router_core/agent_router.h
@@ -21,7 +21,7 @@
 
 #include "router_core_private.h"
 
-#define QDR_ROUTER_COLUMN_COUNT  23
+#define QDR_ROUTER_COLUMN_COUNT  24
 
 const char *qdr_router_columns[QDR_ROUTER_COLUMN_COUNT + 1];
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4ca0d809/tools/qdstat
----------------------------------------------------------------------
diff --git a/tools/qdstat b/tools/qdstat
index 1e8ced3..5bd076f 100755
--- a/tools/qdstat
+++ b/tools/qdstat
@@ -210,6 +210,7 @@ class BusManager(Node):
         objects = self.query('org.apache.qpid.dispatch.router')
 
         router = objects[0]
+        rows.append(('Version',       router.version))
         rows.append(('Mode',          router.mode))
         rows.append(('Area',          router.area))
         rows.append(('Router Id',     router.routerId))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message