flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3589) Allow setting Operator parallelism to default value
Date Mon, 04 Apr 2016 15:27:25 GMT

    [ https://issues.apache.org/jira/browse/FLINK-3589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15224328#comment-15224328
] 

ASF GitHub Bot commented on FLINK-3589:
---------------------------------------

Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1778#discussion_r58394697
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java ---
    @@ -64,10 +64,15 @@
     
     	/**
     	 * The constant to use for the parallelism, if the system should use the number
    -	 *  of currently available slots.
    +	 * of currently available slots.
     	 */
     	public static final int PARALLELISM_AUTO_MAX = Integer.MAX_VALUE;
     
    +	/**
    +	 * The flag value indicating an unknown or unset parallelism.
    +	 */
    +	public static final int PARALLELISM_UNKNOWN = -1;
    --- End diff --
    
    The parallelism may be overridden elsewhere and we are not resetting it back to the default.
This flag simply indicates a value for which the parallelism will not be overridden.


> 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
>
> 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)

Mime
View raw message