private StreamEdge getOrCreateStreamEdge(StreamSpec streamSpec, boolean isIntermediate) {
    String streamId = streamSpec.getId();
    StreamEdge edge = edges.get(streamId);
    if (edge == null) {
      boolean isBroadcast = appDesc.getIntermediateBroadcastStreamIds().contains(streamId);
      edge = new StreamEdge(streamSpec, isIntermediate, isBroadcast, config);
      edges.put(streamId, edge);
    }
    return edge;
  }
Get the {@link StreamEdge} for a {@link StreamSpec}. Create one if it does not exist.
@param streamSpec  spec of the StreamEdge
@param isIntermediate  boolean flag indicating whether it's an intermediate stream
@return stream edge
samza-core/src/main/java/org/apache/samza/execution/JobGraph.java