public void addInEdge(StreamEdge inEdge) { if (inEdge.getTargetId() != getId()) { throw new IllegalArgumentException("Destination id doesn't match the StreamNode id"); } else { inEdges.add(inEdge); } }
public StreamEdge(StreamNode sourceVertex, StreamNode targetVertex, int typeNumber, List<String> selectedNames, StreamPartitioner<?> outputPartitioner, OutputTag outputTag) { this.sourceId = sourceVertex.getId(); this.targetId = targetVertex.getId(); this.typeNumber = typeNumber; this.selectedNames = selectedNames; this.outputPartitioner = outputPartitioner; this.outputTag = outputTag; this.sourceOperatorName = sourceVertex.getOperatorName(); this.targetOperatorName = targetVertex.getOperatorName(); this.edgeId = sourceVertex + "_" + targetVertex + "_" + typeNumber + "_" + selectedNames + "_" + outputPartitioner; }
public void addOutEdge(StreamEdge outEdge) { if (outEdge.getSourceId() != getId()) { throw new IllegalArgumentException("Source id doesn't match the StreamNode id"); } else { outEdges.add(outEdge); } }
public Set<Tuple2<Integer, StreamOperator<?>>> getOperators() { Set<Tuple2<Integer, StreamOperator<?>>> operatorSet = new HashSet<>(); for (StreamNode vertex : streamNodes.values()) { operatorSet.add(new Tuple2<Integer, StreamOperator<?>>(vertex.getId(), vertex .getOperator())); } return operatorSet; }
private void removeVertex(StreamNode toRemove) { Set<StreamEdge> edgesToRemove = new HashSet<>(); edgesToRemove.addAll(toRemove.getInEdges()); edgesToRemove.addAll(toRemove.getOutEdges()); for (StreamEdge edge : edgesToRemove) { removeEdge(edge); } streamNodes.remove(toRemove.getId()); }
@Override public Map<Integer, byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph) { HashMap<Integer, byte[]> hashResult = new HashMap<>(); for (StreamNode streamNode : streamGraph.getStreamNodes()) { String userHash = streamNode.getUserHash(); if (null != userHash) { hashResult.put(streamNode.getId(), StringUtils.hexStringToByte(userHash)); } } return hashResult; } }
null, "IterationSource-" + loopId); sources.add(source.getId()); setParallelism(source.getId(), parallelism); setMaxParallelism(source.getId(), maxParallelism); setResources(source.getId(), minResources, preferredResources); null, "IterationSink-" + loopId); sinks.add(sink.getId()); setParallelism(sink.getId(), parallelism); setMaxParallelism(sink.getId(), parallelism); this.vertexIDtoBrokerID.put(source.getId(), "broker-" + loopId); this.vertexIDtoBrokerID.put(sink.getId(), "broker-" + loopId); this.vertexIDtoLoopTimeout.put(source.getId(), timeout); this.vertexIDtoLoopTimeout.put(sink.getId(), timeout);
streamGraph.setSerializers(itSource.getId(), null, null, iterate.getOutputType().createSerializer(env.getConfig())); streamGraph.setSerializers(itSink.getId(), iterate.getOutputType().createSerializer(env.getConfig()), null, null); resultIds.add(itSource.getId()); for (Integer feedbackId: feedbackIds) { streamGraph.addEdge(feedbackId, itSink.getId(),
streamGraph.setSerializers(itSource.getId(), null, null, coIterate.getOutputType().createSerializer(env.getConfig())); streamGraph.setSerializers(itSink.getId(), coIterate.getOutputType().createSerializer(env.getConfig()), null, null); Collection<Integer> resultIds = Collections.singleton(itSource.getId()); for (Integer feedbackId: feedbackIds) { streamGraph.addEdge(feedbackId, itSink.getId(), itSource.setSlotSharingGroup(slotSharingGroup); return Collections.singleton(itSource.getId());
"'" + node.toString() + "' {id: " + node.getId() + ", " + "parallelism: " + node.getParallelism() + ", " + "user function: " + udfClassName + "}");
assertEquals(rebalanceMap.getId(), graph.getSourceVertex(graph.getStreamNode(broadcastMap.getId()).getInEdges().get(0)).getId());
public void addInEdge(StreamEdge inEdge) { if (inEdge.getTargetId() != getId()) { throw new IllegalArgumentException("Destination id doesn't match the StreamNode id"); } else { inEdges.add(inEdge); } }
public void addInEdge(StreamEdge inEdge) { if (inEdge.getTargetId() != getId()) { throw new IllegalArgumentException("Destination id doesn't match the StreamNode id"); } else { inEdges.add(inEdge); } }
public Set<Tuple2<Integer, StreamOperator<?>>> getOperators() { Set<Tuple2<Integer, StreamOperator<?>>> operatorSet = new HashSet<>(); for (StreamNode vertex : streamNodes.values()) { operatorSet.add(new Tuple2<Integer, StreamOperator<?>>(vertex.getId(), vertex .getOperator())); } return operatorSet; }
private void removeVertex(StreamNode toRemove) { Set<StreamEdge> edgesToRemove = new HashSet<>(); edgesToRemove.addAll(toRemove.getInEdges()); edgesToRemove.addAll(toRemove.getOutEdges()); for (StreamEdge edge : edgesToRemove) { removeEdge(edge); } streamNodes.remove(toRemove.getId()); }
@Override public Map<Integer, byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph) { HashMap<Integer, byte[]> hashResult = new HashMap<>(); for (StreamNode streamNode : streamGraph.getStreamNodes()) { String userHash = streamNode.getUserHash(); if (null != userHash) { hashResult.put(streamNode.getId(), StringUtils.hexStringToByte(userHash)); } } return hashResult; } }
@Override public Map<Integer, byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph) { HashMap<Integer, byte[]> hashResult = new HashMap<>(); for (StreamNode streamNode : streamGraph.getStreamNodes()) { String userHash = streamNode.getUserHash(); if (null != userHash) { hashResult.put(streamNode.getId(), StringUtils.hexStringToByte(userHash)); } } return hashResult; } }