void calculatePartitions(JobGraph jobGraph, Collection<StreamSet> joinedStreamSets) {

    // Set partition count of intermediate streams participating in joins
    setJoinedIntermediateStreamPartitions(joinedStreamSets);

    // Set partition count of intermediate streams not participating in joins
    setIntermediateStreamPartitions(jobGraph);

    // Validate partition counts were assigned for all intermediate streams
    validateIntermediateStreamPartitions(jobGraph);
  }
Calculates the number of partitions of all intermediate streams
samza-core/src/main/java/org/apache/samza/execution/IntermediateStreamManager.java