You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Greg Hogan (JIRA)" <ji...@apache.org> on 2016/04/06 21:28:25 UTC

[jira] [Updated] (FLINK-3589) Allow setting Operator parallelism to default value

     [ https://issues.apache.org/jira/browse/FLINK-3589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Hogan updated FLINK-3589:
------------------------------
    Fix Version/s: 1.1.0

> Allow setting Operator parallelism to default value
> ---------------------------------------------------
>
>                 Key: FLINK-3589
>                 URL: https://issues.apache.org/jira/browse/FLINK-3589
>             Project: Flink
>          Issue Type: Improvement
>          Components: Java API
>    Affects Versions: 1.1.0
>            Reporter: Greg Hogan
>            Assignee: Greg Hogan
>            Priority: Minor
>             Fix For: 1.1.0
>
>
> 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:
> {code}
> 	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);
> 		}
> {code}
> Could be simplified to:
> {code}
> 	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");
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)