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

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

GitHub user greghogan opened a pull request:

    https://github.com/apache/flink/pull/1778

    [FLINK-3589] Allow setting Operator parallelism to default value

    Adds the public field ExecutionConfig.PARALLELISM_UNKNOWN as a flag
    value to indicate that the default parallelism should be used.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/greghogan/flink 
3589_allow_setting_operator_parallelism_to_default_value

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1778.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1778
    
----
commit 8c573e22cf74c9445df130bbbbbb80d69cbd3649
Author: Greg Hogan <[email protected]>
Date:   2016-03-09T17:41:45Z

    [FLINK-3589] Allow setting Operator parallelism to default value
    
    Adds the public field ExecutionConfig.PARALLELISM_UNKNOWN as a flag
    value to indicate that the default parallelism should be used.

----


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

Reply via email to