qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject [2/2] qpid-dispatch git commit: DISPATCH-242 - Exposed operStatus of link routes in qdstat.
Date Mon, 18 Apr 2016 18:11:26 GMT
DISPATCH-242 - Exposed operStatus of link routes in qdstat.


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

Branch: refs/heads/master
Commit: fac17aa758baa54dd0994b16fa558fafc10893a0
Parents: ea42feb
Author: Ted Ross <tross@redhat.com>
Authored: Mon Apr 18 14:10:44 2016 -0400
Committer: Ted Ross <tross@redhat.com>
Committed: Mon Apr 18 14:10:44 2016 -0400

----------------------------------------------------------------------
 python/qpid_dispatch/management/qdrouter.json | 5 +++++
 src/router_core/agent_config_link_route.c     | 7 +++++++
 src/router_core/agent_config_link_route.h     | 2 +-
 src/router_core/connections.c                 | 2 +-
 src/router_core/route_control.c               | 4 ++++
 src/router_core/router_core_private.h         | 1 +
 tools/qdstat                                  | 2 ++
 7 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index 1ebfab0..8fb40ba 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -950,6 +950,11 @@
                     "description": "The permitted direction of links: 'in' means client senders;
'out' means client receivers",
                     "create": true,
                     "required": true
+                },
+                "operStatus": {
+                    "type": ["inactive", "active"],
+                    "description": "The operational status of this linkRoute: inactive -
The remote container is not connected; active - the remote container is connected and ready
to accept link routed attachments.",
+                    "create": false
                 }
             }
         },

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/src/router_core/agent_config_link_route.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent_config_link_route.c b/src/router_core/agent_config_link_route.c
index b07c916..5413ffd 100644
--- a/src/router_core/agent_config_link_route.c
+++ b/src/router_core/agent_config_link_route.c
@@ -31,6 +31,7 @@
 #define QDR_CONFIG_LINK_ROUTE_CONNECTION    5
 #define QDR_CONFIG_LINK_ROUTE_CONTAINER_ID  6
 #define QDR_CONFIG_LINK_ROUTE_DIR           7
+#define QDR_CONFIG_LINK_ROUTE_OPER_STATUS   8
 
 const char *qdr_config_link_route_columns[] =
     {"name",
@@ -41,6 +42,7 @@ const char *qdr_config_link_route_columns[] =
      "connection",
      "containerId",
      "dir",
+     "operStatus",
      0};
 
 
@@ -113,6 +115,11 @@ static void qdr_config_link_route_insert_column_CT(qdr_link_route_t *lr,
int col
         text = lr->dir == QD_INCOMING ? "in" : "out";
         qd_compose_insert_string(body, text);
         break;
+
+    case QDR_CONFIG_LINK_ROUTE_OPER_STATUS:
+        text = lr->active ? "active" : "inactive";
+        qd_compose_insert_string(body, text);
+        break;
     }
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/src/router_core/agent_config_link_route.h
----------------------------------------------------------------------
diff --git a/src/router_core/agent_config_link_route.h b/src/router_core/agent_config_link_route.h
index b470de8..7c4a044 100644
--- a/src/router_core/agent_config_link_route.h
+++ b/src/router_core/agent_config_link_route.h
@@ -28,7 +28,7 @@ void qdra_config_link_route_update_CT(qdr_core_t *core, qdr_query_t *query,
qd_p
 void qdra_config_link_route_delete_CT(qdr_core_t *core, qdr_query_t *query, qd_field_iterator_t
*name,
                                 qd_field_iterator_t *identity);
 
-#define QDR_CONFIG_LINK_ROUTE_COLUMN_COUNT 8
+#define QDR_CONFIG_LINK_ROUTE_COLUMN_COUNT 9
 
 const char *qdr_config_link_route_columns[QDR_CONFIG_LINK_ROUTE_COLUMN_COUNT + 1];
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/src/router_core/connections.c
----------------------------------------------------------------------
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index 03b96cb..88de922 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -272,7 +272,7 @@ qdr_link_t *qdr_link_first_attach(qdr_connection_t *conn,
     link->name = (char*) malloc(strlen(name) + 1);
     strcpy(link->name, name);
     link->link_direction = dir;
-    link->capacity       = conn->link_capacity;
+    link->capacity       = dir == QD_INCOMING ? conn->link_capacity : 0;
     link->admin_enabled  = true;
     link->oper_status    = QDR_LINK_OPER_DOWN;
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/src/router_core/route_control.c
----------------------------------------------------------------------
diff --git a/src/router_core/route_control.c b/src/router_core/route_control.c
index 1e280a2..7cba7a7 100644
--- a/src/router_core/route_control.c
+++ b/src/router_core/route_control.c
@@ -92,6 +92,8 @@ static void qdr_link_route_activate_CT(qdr_core_t *core, qdr_link_route_t
*lr, q
                 qdr_post_mobile_added_CT(core, key);
         }
     }
+
+    lr->active = true;
 }
 
 
@@ -112,6 +114,8 @@ static void qdr_link_route_deactivate_CT(qdr_core_t *core, qdr_link_route_t
*lr,
                 qdr_post_mobile_removed_CT(core, key);
         }
     }
+
+    lr->active = false;
 }
 
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/src/router_core/router_core_private.h
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_private.h b/src/router_core/router_core_private.h
index 601c45e..62b8136 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -437,6 +437,7 @@ struct qdr_link_route_t {
     qd_direction_t          dir;
     qdr_conn_identifier_t  *conn_id;
     qd_address_treatment_t  treatment;
+    bool                    active;
 };
 
 ALLOC_DECLARE(qdr_link_route_t);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fac17aa7/tools/qdstat
----------------------------------------------------------------------
diff --git a/tools/qdstat b/tools/qdstat
index 94c1196..327eb1a 100755
--- a/tools/qdstat
+++ b/tools/qdstat
@@ -362,6 +362,7 @@ class BusManager(Node):
         heads.append(Header("prefix"))
         heads.append(Header("dir"))
         heads.append(Header("distrib"))
+        heads.append(Header("status"))
         rows = []
 
         link_routes = self.query('org.apache.qpid.dispatch.router.config.linkRoute')
@@ -371,6 +372,7 @@ class BusManager(Node):
             row.append(link_route.prefix)
             row.append(link_route.dir)
             row.append(link_route.distribution)
+            row.append(link_route.operStatus)
             rows.append(row)
         title = "Link Routes"
         sorter = Sorter(heads, rows, 'prefix', 0, True)


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


Mime
View raw message