MCPcopy Create free account
hub / github.com/apache/storm / parseEdge

Function parseEdge

storm-webapp/src/main/webapp/js/visualization.js:317–346  ·  view source on GitHub ↗
(edgeJson, sourceId)

Source from the content-addressed store, hash-verified

315}
316
317function parseEdge(edgeJson, sourceId) {
318 //console.log(edgeJson);
319
320 // Make this stream available
321 addAvailableStream(edgeJson[":stream"], edgeJson[":sani-stream"])
322
323 // Create a unique Id
324 var id = edgeJson[":component"] + ":" + sourceId + ":" + edgeJson[":sani-stream"];
325
326 // Determine if stream is enabled
327 if (!isStreamEnabled(edgeJson[":sani-stream"])) {
328 // Remove edge
329 visNS.edges.remove({ "id": id });
330 return
331 }
332
333 if (!visNS.edges.get(id)) {
334 visNS.edges.update({
335 "id": id,
336 "from": edgeJson[":component"],
337 "to": sourceId,
338 "label": edgeJson[":stream"],
339 "title": tooltipElement([
340 { text: "From: " + edgeJson[":component"] },
341 { text: "To: " + sourceId },
342 { text: "Grouping: " + edgeJson[":grouping"] }
343 ])
344 });
345 }
346}
347
348function addAvailableStream(streamId, streamIdSanitized) {
349 // Create a master list of all streams

Callers 1

parseNodeFunction · 0.85

Calls 6

addAvailableStreamFunction · 0.85
isStreamEnabledFunction · 0.85
tooltipElementFunction · 0.85
removeMethod · 0.65
getMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected