You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2018/11/11 14:08:45 UTC
qpid-dispatch git commit: DISPATCH-1180 Check link address before
attributing traffic to a connection
Repository: qpid-dispatch
Updated Branches:
refs/heads/master effa12466 -> 58fd3d5b6
DISPATCH-1180 Check link address before attributing traffic to a connection
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/58fd3d5b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/58fd3d5b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/58fd3d5b
Branch: refs/heads/master
Commit: 58fd3d5b6620e3f69d726ea1e20bfc3d1e5c23a9
Parents: effa124
Author: Ernest Allen <ea...@redhat.com>
Authored: Sun Nov 11 09:08:31 2018 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Sun Nov 11 09:08:31 2018 -0500
----------------------------------------------------------------------
console/stand-alone/plugin/js/amqp/topology.js | 19 ++++-----------
console/stand-alone/plugin/js/topology/nodes.js | 3 +--
.../plugin/js/topology/qdrTopology.js | 8 +++----
.../stand-alone/plugin/js/topology/traffic.js | 25 ++++++++++++++++----
4 files changed, 28 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/58fd3d5b/console/stand-alone/plugin/js/amqp/topology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/amqp/topology.js b/console/stand-alone/plugin/js/amqp/topology.js
index edfbbb3..d1dfa1a 100644
--- a/console/stand-alone/plugin/js/amqp/topology.js
+++ b/console/stand-alone/plugin/js/amqp/topology.js
@@ -267,25 +267,14 @@ class Topology {
}
// ensure these nodes have all these entities. don't fetch unless forced to
ensureEntities(nodes, entityAttribs, callback, extra) {
- if (Object.prototype.toString.call(entityAttribs) !== '[object Array]') {
- entityAttribs = [entityAttribs];
- }
if (Object.prototype.toString.call(nodes) !== '[object Array]') {
nodes = [nodes];
}
this.addUpdateEntities(entityAttribs);
- var q = d3.queue(this.connection.availableQeueuDepth());
- for (var n = 0; n < nodes.length; ++n) {
- for (var i = 0; i < entityAttribs.length; ++i) {
- var ea = entityAttribs[i];
- // if we don'e already have the entity or we want to force a refresh
- if (!this._nodeInfo[nodes[n]][ea.entity] || ea.force)
- q.defer((this.q_ensureNodeInfo).bind(this), nodes[n], ea.entity, ea.attrs || [], q);
- }
- }
- q.await(function () {
- callback(extra);
- });
+ this.doget(nodes)
+ .then( function (results) {
+ callback(extra, results);
+ });
}
addNodeInfo(id, entity, values) {
// save the results in the nodeInfo object
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/58fd3d5b/console/stand-alone/plugin/js/topology/nodes.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/nodes.js b/console/stand-alone/plugin/js/topology/nodes.js
index f852407..2715541 100644
--- a/console/stand-alone/plugin/js/topology/nodes.js
+++ b/console/stand-alone/plugin/js/topology/nodes.js
@@ -94,9 +94,8 @@ export class Node {
QDRService.management.topology.ensureEntities(this.key, [
{entity: 'listener', attrs: ['role', 'port', 'http']},
{entity: 'router', attrs: ['name', 'version', 'hostName']}
- ], function () {
+ ], function (foo, nodes) {
// update all the router title text
- let nodes = QDRService.management.topology.nodeInfo();
let node = nodes[this.key];
const err = `<table class="popupTable"><tr><td>Error</td><td>Unable to get router info for ${this.key}</td></tr></table>`;
if (!node) {
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/58fd3d5b/console/stand-alone/plugin/js/topology/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/qdrTopology.js b/console/stand-alone/plugin/js/topology/qdrTopology.js
index e0a9cb4..7e299ab 100644
--- a/console/stand-alone/plugin/js/topology/qdrTopology.js
+++ b/console/stand-alone/plugin/js/topology/qdrTopology.js
@@ -393,12 +393,10 @@ export class TopologyController {
unknownNodes[unknowns[i].key] = 1;
}
unknownNodes = Object.keys(unknownNodes);
- //QDRLog.info("-- resolveUnknowns: ensuring .connection and .router.link are present for each node")
- QDRService.management.topology.ensureEntities(unknownNodes, [{entity: 'connection', force: true},
- {entity: 'router.link', attrs: ['linkType','connectionId','linkDir'], force: true}], function () {
- nodeInfo = QDRService.management.topology.nodeInfo();
+ QDRService.management.topology.ensureEntities(unknownNodes, [
+ {entity: 'router.link', attrs: ['linkType','connectionId','linkDir','owningAddr'], force: true}], function (foo, results) {
forceData.links = links = new Links(QDRService, QDRLog);
- links.initializeLinks(nodeInfo, nodes, [], localStorage, height);
+ links.initializeLinks(results, nodes, [], localStorage, height);
animate = true;
force.nodes(nodes.nodes).links(links.links).start();
restart(false);
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/58fd3d5b/console/stand-alone/plugin/js/topology/traffic.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/topology/traffic.js b/console/stand-alone/plugin/js/topology/traffic.js
index 73e30bd..f109f61 100644
--- a/console/stand-alone/plugin/js/topology/traffic.js
+++ b/console/stand-alone/plugin/js/topology/traffic.js
@@ -420,11 +420,26 @@ class Dots extends TrafficAnimation {
for (let n = 0; n < nodes.length; n++) {
let node = nodes[n];
if (node.normals && node.key === nodes[f].key && (node.cdir === cdir || node.cdir === 'both')) {
- let key = ['', f, n].join('-');
- if (!hops[key])
- hops[key] = [];
- hops[key].push({ val: val, back: !sender, address: address });
- return;
+ let links = this.traffic.QDRService.management.topology._nodeInfo[node.key]['router.link'];
+ // find the 1st link with type 'endpoint' and owningAddr == address
+ if (!links)
+ continue;
+ for (let l=0; l<links.results.length; l++) {
+ let link = this.traffic.QDRService.utilities.flatten(links.attributeNames, links.results[l]);
+ if ((link.linkType === 'endpoint' ||
+ link.linkType === 'edge-downlink') &&
+ address === this.traffic.QDRService.utilities.addr_text(link.owningAddr)) {
+ for (let n1=n; n1<nodes.length; n1++) {
+ if (link.connectionId === nodes[n1].connectionId) {
+ let key = ['', f, n1].join('-');
+ if (!hops[key])
+ hops[key] = [];
+ hops[key].push({ val: val, back: !sender, address: address });
+ return;
+ }
+ }
+ }
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org