Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3589

Allow setting Operator parallelism to default value

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1.0
    • 1.1.0
    • None
    • None

    Description

      User's can override the parallelism for a single operator by calling Operator.setParallelism, which accepts a positive value. Operator uses -1 to indicate default parallelism. It would be nice to name and accept this default value.

      This would enable user algorithms to allow configurable parallelism while still chaining operator methods.

      For example, currently:

      	private int parallelism;
      	...
      	public void setParallelism(int parallelism) {
      		this.parallelism = parallelism;
      	}
      	...
      		MapOperator<Edge<K,LongValue>, Edge<K,IntValue>> newEdges = edges
      			.map(new MyMapFunction<K>())
      				.name("My map function");
      
      		if (parallelism > 0) {
      			newEdges.setParallelism(parallelism);
      		}
      

      Could be simplified to:

      	private int parallelism = Operator.DEFAULT_PARALLELISM;
      	...
      	public void setParallelism(int parallelism) {
      		this.parallelism = parallelism;
      	}
      	...
      		DataSet<Edge<K,IntValue>> newEdges = edges
      			.map(new MyMapFunction<K>())
      			.setParallelism(parallelism)
      				.name("My map function");
      

      Attachments

        Issue Links

          Activity

            People

              greghogan Greg Hogan
              greghogan Greg Hogan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: