Class ForwardGroupComputeUtil


  • public class ForwardGroupComputeUtil
    extends Object
    Common utils for computing forward groups.
    • Constructor Detail

      • ForwardGroupComputeUtil

        public ForwardGroupComputeUtil()
    • Method Detail

      • computeStreamNodeForwardGroup

        public static Map<Integer,​StreamNodeForwardGroup> computeStreamNodeForwardGroup​(Iterable<StreamNode> topologicallySortedStreamNodes,
                                                                                              Function<StreamNode,​Set<StreamNode>> forwardProducersRetriever)
        We calculate forward group by a set of stream nodes.
        Parameters:
        topologicallySortedStreamNodes - topologically sorted chained stream nodes
        forwardProducersRetriever - records all upstream stream nodes which connected to the given stream node with forward edge
        Returns:
        a map of forward groups, with the stream node id as the key
      • canTargetMergeIntoSourceForwardGroup

        public static boolean canTargetMergeIntoSourceForwardGroup​(ForwardGroup<?> sourceForwardGroup,
                                                                   ForwardGroup<?> forwardGroupToMerge)
        Determines whether the target forward group can be merged into the source forward group.
        Parameters:
        sourceForwardGroup - The source forward group.
        forwardGroupToMerge - The forward group needs to be merged.
        Returns:
        whether the merge is valid.