Class ParallelismStrategy

    • Field Detail

      • NON_PARALLELIZABLE

        public static final ParallelismStrategy NON_PARALLELIZABLE
        Indicates that the operator is non-parallelizable.
      • NEGOTIATE_BASED_ON_SOURCE

        public static final ParallelismStrategy NEGOTIATE_BASED_ON_SOURCE
        Uses the maximum of the input ports' parallelism as this operator's max parallelism. If there are no parallel inputs, this will use Integer.MAX_VALUE as its parallelism, forcing a "scatter" from the inputs. If this operator has an explicit OperatorSettings.maxParallelism(int) specified on it or inherited from its parent, this will favor the explicit setting.
      • ACCEPT_SOURCE

        public static final ParallelismStrategy ACCEPT_SOURCE
        Uses the maximum of the input ports' parallelism as this operator's max parallelism. In contrast to NEGOTIATE_BASED_ON_SOURCE, parallelism of 1 is a valid value and thus we will only be parallel if the source is parallel. If this operator has an explicit OperatorSettings.maxParallelism(int) specified on it or inherited from its parent, this will favor the explicit setting.
    • Constructor Detail

      • ParallelismStrategy

        public ParallelismStrategy()
    • Method Detail

      • maxParallelism

        public abstract Integer maxParallelism​(Integer configuredParallelism,
                                               MetadataCalculationContext ctx)
        Public only as a matter of implementation; operators should not call this method. Computes the max parallelism to use.
        Parameters:
        configuredParallelism - the parallelism explicitly configured or null if unspecified
        ctx - the context that the function can use to determine port inputs, etc
        Returns:
        the max parallelism. a value of null will be interpretted as Integer.MAX_VALUE (unconstrained).