Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dashboard/components/StreamingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ const SvgBoxCover = styled('div')(() => ({


export default function StreamingView(props) {
console.log("called.")
const node = props.node;
const actorProto = props.actorProto;
const [nodeJson, setNodeJson] = useState("");
const [showInfoPane, setShowInfoPane] = useState(false);
const d3Container = useRef(null);

actorProto.actors = actorProto.actors || [];

const onNodeClick = (e, node) => {
setShowInfoPane(true);
setNodeJson(node.dispatcherType
Expand All @@ -40,7 +41,7 @@ export default function StreamingView(props) {
};

useEffect(() => {
if (d3Container.current && (svg === undefined)) {
if (d3Container.current) {
const width = 1000;
const height = 1000;

Expand Down
12 changes: 9 additions & 3 deletions dashboard/lib/streamPlan/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class StreamNode extends Node {
Actor.parseActor(actorId2Proto.get(upStreamActorId)).output.push(this);
}
}

if (this.type === "chainNode") {
for (let upStreamActorId of this.typeInfo.upstreamActorIds) {
Actor.parseActor(actorId2Proto.get(upStreamActorId)).output.push(this);
}
}
}

parseType(nodeProto) {
Expand Down Expand Up @@ -67,11 +73,11 @@ class Dispatcher extends Node {
}

class Actor {
constructor(actorId, output, rootNode, fragmentIdentifier) {
constructor(actorId, output, rootNode, fragmentId) {
this.actorId = actorId;
this.output = output;
this.rootNode = rootNode;
this.fragmentIdentifier = fragmentIdentifier;
this.fragmentId = fragmentId;
}

static parseActor(actorProto) {
Expand All @@ -80,7 +86,7 @@ class Actor {
return parsedActorMap.get(actorId);
}

let actor = new Actor(actorId, [], null, actorProto.nodes.operatorId);
let actor = new Actor(actorId, [], null, actorProto.fragmentId);
parsedActorMap.set(actorId, actor);
let nodeBeforeDispatcher = StreamNode.parseNode(actor.actorId, actorProto.nodes);
let rootNode = Dispatcher.newDispatcher(actor.actorId, actorProto.dispatcher.type, actorProto.downstreamActorId);
Expand Down
18 changes: 9 additions & 9 deletions dashboard/lib/streamPlan/streamChartHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export class StreamChartHelper {
.attr("x", baseX)
.attr("y", baseY - actorBoxStroke)
.attr("font-size", fontSize)
.text("Actors: " + actor.representedActorList);
.text(`Fragment ${actor.fragmentId}, Actor ${actor.representedActorList}`);

// draw links
const linkData = [];
Expand Down Expand Up @@ -483,9 +483,9 @@ export class StreamChartHelper {
})

// dataflow effect
group.selectAll("path")
.attr("stroke-dasharray", linkStrokeDash);
if (DrawLinkEffect) {
group.selectAll("path")
.attr("stroke-dasharray", linkStrokeDash);
function repeat() {
group.selectAll("path")
.attr("stroke-dashoffset", "0")
Expand Down Expand Up @@ -655,9 +655,9 @@ export class StreamChartHelper {
.style("stroke-width", 20)
.attr("stroke", s => actorOutgoinglinkColor(s.actor));
// dataflow effect
linkLayer.selectAll("path")
.attr("stroke-dasharray", "20, 20");
if (DrawLinkEffect) {
linkLayer.selectAll("path")
.attr("stroke-dasharray", "20, 20");
function repeat() {
linkLayer.selectAll("path")
.attr("stroke-dashoffset", "40")
Expand Down Expand Up @@ -715,15 +715,15 @@ export class StreamChartHelper {
const dispatcherNode2ActorId = new Map();
const fragmentRepresentedActors = [];
for (let actor of allActors) {
if (!dispatcherNode2ActorId.has(actor.fragmentIdentifier)) {
if (!dispatcherNode2ActorId.has(actor.fragmentId)) {
fragmentRepresentedActors.push(actor);
dispatcherNode2ActorId.set(actor.fragmentIdentifier, [actor.actorId]);
dispatcherNode2ActorId.set(actor.fragmentId, [actor.actorId]);
} else {
dispatcherNode2ActorId.get(actor.fragmentIdentifier).push(actor.actorId);
dispatcherNode2ActorId.get(actor.fragmentId).push(actor.actorId);
}
}
for (let actor of fragmentRepresentedActors) {
actor.representedActorList = dispatcherNode2ActorId.get(actor.fragmentIdentifier);
actor.representedActorList = dispatcherNode2ActorId.get(actor.fragmentId);
}

// get dag layout of these actors
Expand Down