private static void validatePartitions(StreamSet streamSet) {
    Collection<StreamEdge> streamEdges = streamSet.getStreamEdges();
    StreamEdge referenceStreamEdge = streamEdges.stream().findFirst().get();
    int referencePartitions = referenceStreamEdge.getPartitionCount();

    for (StreamEdge streamEdge : streamEdges) {
      int partitions = streamEdge.getPartitionCount();
      if (partitions != referencePartitions) {
        throw  new SamzaException(String.format(
            "Unable to resolve input partitions of stream %s for the join %s. Expected: %d, Actual: %d",
            referenceStreamEdge.getName(), streamSet.getSetId(), referencePartitions, partitions));
      }
    }
  }
Verifies all {@link StreamEdge}s in the supplied {@code streamSet} agree in
partition count, or throws.
samza-core/src/main/java/org/apache/samza/execution/ExecutionPlanner.java