数厂代码,未实现
伪负载均衡
// 伪负载均衡 /* ;(() => { let nodes = JSON.parse(JSON.stringify(data.nodes)); let edges = JSON.parse(JSON.stringify(data.edges)); // 排查特殊节点并记录 let start_node = null, start_ready_node = null, end_node = null, end_ready_node = null; nodes.map(inode=>{ if(inode.name === '流程开始'){ start_node = inode; }else if(inode.name === 'http流程预处理算子'){ start_ready_node = inode; }else if(inode.name === '流程结束'){ end_node = inode; }else if(inode.name === 'http流程属性输出算子'){ end_ready_node = inode; } }) // 复制非特殊节点和连线 const loadNum = 1; for(let i = 0;i<loadNum;i++){ const j = i + 1; nodes.map((inode,ni)=>{ const node = JSON.parse(JSON.stringify(inode)); node.id = uuid(); node.y += 500*j; if( node.name !== '流程结束' && node.name !== '流程开始' && node.name !== 'http流程预处理算子' && node.name !== 'http流程属性输出算子' ){ data.nodes.splice(ni,0,node) edges.map((iedge,ei)=>{ const edge = JSON.parse(JSON.stringify(iedge)); if(edge.targetid === inode.id){ if(edge.sourceid === start_ready_node.id){ // edge.outputport = 'out'+j console.log("ff",edge) } edge.targetid = node.id; data.edges.splice(ei,0,edge) }else if(edge.sourceid === inode.id && edge.targetid === end_ready_node.id){ edge.sourceid = node.id; data.edges.splice(ei,0,edge) } }) } }) } })() */
标签:node,负载,name,流程,JSON,edge,拷贝,inode,id From: https://www.cnblogs.com/muzhang/p/17562960.html