[jira] [Commented] (FLINK-10321) Make the condition of broadcast partitioner simple
[ https://issues.apache.org/jira/browse/FLINK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16614561#comment-16614561 ] ASF GitHub Bot commented on FLINK-10321: pnowojski closed pull request #6688: [FLINK-10321][network] Simplify the condition of BroadcastPartitioner URL: https://github.com/apache/flink/pull/6688 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/partitioner/BroadcastPartitioner.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/partitioner/BroadcastPartitioner.java index 3d0e108bf28..c796813adc5 100644 --- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/partitioner/BroadcastPartitioner.java +++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/partitioner/BroadcastPartitioner.java @@ -30,22 +30,18 @@ public class BroadcastPartitioner extends StreamPartitioner { private static final long serialVersionUID = 1L; - int[] returnArray; - boolean set; - int setNumber; + private int[] returnArray; @Override public int[] selectChannels(SerializationDelegate> record, int numberOfOutputChannels) { - if (set && setNumber == numberOfOutputChannels) { + if (returnArray != null && returnArray.length == numberOfOutputChannels) { return returnArray; } else { this.returnArray = new int[numberOfOutputChannels]; for (int i = 0; i < numberOfOutputChannels; i++) { returnArray[i] = i; } - set = true; - setNumber = numberOfOutputChannels; return returnArray; } } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Make the condition of broadcast partitioner simple > -- > > Key: FLINK-10321 > URL: https://issues.apache.org/jira/browse/FLINK-10321 > Project: Flink > Issue Type: Improvement > Components: Network >Affects Versions: 1.7.0 >Reporter: zhijiang >Assignee: zhijiang >Priority: Minor > Labels: pull-request-available > > The current {{BroadcastPartitioner}} uses the vars of {{set}} and > {{setNumber}} as the condition for returning channel arrays. > Instead of using {{set}} and {{setNumber}}, we can just check whether > {{returnChannel.length == numberOfOutputChannels}} as the condition to make > it simple. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10321) Make the condition of broadcast partitioner simple
[ https://issues.apache.org/jira/browse/FLINK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16614562#comment-16614562 ] ASF GitHub Bot commented on FLINK-10321: pnowojski commented on issue #6688: [FLINK-10321][network] Simplify the condition of BroadcastPartitioner URL: https://github.com/apache/flink/pull/6688#issuecomment-421288787 Thanks for the contribution! Merged. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Make the condition of broadcast partitioner simple > -- > > Key: FLINK-10321 > URL: https://issues.apache.org/jira/browse/FLINK-10321 > Project: Flink > Issue Type: Improvement > Components: Network >Affects Versions: 1.7.0 >Reporter: zhijiang >Assignee: zhijiang >Priority: Minor > Labels: pull-request-available > > The current {{BroadcastPartitioner}} uses the vars of {{set}} and > {{setNumber}} as the condition for returning channel arrays. > Instead of using {{set}} and {{setNumber}}, we can just check whether > {{returnChannel.length == numberOfOutputChannels}} as the condition to make > it simple. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10321) Make the condition of broadcast partitioner simple
[ https://issues.apache.org/jira/browse/FLINK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613562#comment-16613562 ] ASF GitHub Bot commented on FLINK-10321: Aitozi commented on issue #6688: [FLINK-10321][network] Simplify the condition of BroadcastPartitioner URL: https://github.com/apache/flink/pull/6688#issuecomment-421025756 LGTM. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Make the condition of broadcast partitioner simple > -- > > Key: FLINK-10321 > URL: https://issues.apache.org/jira/browse/FLINK-10321 > Project: Flink > Issue Type: Improvement > Components: Network >Affects Versions: 1.7.0 >Reporter: zhijiang >Assignee: zhijiang >Priority: Minor > Labels: pull-request-available > > The current {{BroadcastPartitioner}} uses the vars of {{set}} and > {{setNumber}} as the condition for returning channel arrays. > Instead of using {{set}} and {{setNumber}}, we can just check whether > {{returnChannel.length == numberOfOutputChannels}} as the condition to make > it simple. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10321) Make the condition of broadcast partitioner simple
[ https://issues.apache.org/jira/browse/FLINK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613561#comment-16613561 ] ASF GitHub Bot commented on FLINK-10321: TisonKun commented on issue #6688: [FLINK-10321][network] Simplify the condition of BroadcastPartitioner URL: https://github.com/apache/flink/pull/6688#issuecomment-421024900 FYI, travis fails by irrelevant issue. ``` Status: Downloaded newer image for java:8-jre-alpine ---> fdc893b19a14 Step 2/16 : RUN apk add --no-cache bash snappy ---> [Warning] IPv4 forwarding is disabled. Networking will not work. ---> Running in 04ebab036ceb fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz: temporary error (try again later) fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz: temporary error (try again later) ERROR: unsatisfiable constraints: bash (missing): required by: world[bash] snappy (missing): required by: world[snappy] The command '/bin/sh -c apk add --no-cache bash snappy' returned a non-zero code: 2 No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself. Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received The build has been terminated ``` @zentol is it something wrong on travis or our script? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Make the condition of broadcast partitioner simple > -- > > Key: FLINK-10321 > URL: https://issues.apache.org/jira/browse/FLINK-10321 > Project: Flink > Issue Type: Improvement > Components: Network >Affects Versions: 1.7.0 >Reporter: zhijiang >Assignee: zhijiang >Priority: Minor > Labels: pull-request-available > > The current {{BroadcastPartitioner}} uses the vars of {{set}} and > {{setNumber}} as the condition for returning channel arrays. > Instead of using {{set}} and {{setNumber}}, we can just check whether > {{returnChannel.length == numberOfOutputChannels}} as the condition to make > it simple. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10321) Make the condition of broadcast partitioner simple
[ https://issues.apache.org/jira/browse/FLINK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613061#comment-16613061 ] ASF GitHub Bot commented on FLINK-10321: zhijiangW commented on issue #6688: [FLINK-10321][network] Simplify the condition of BroadcastPartitioner URL: https://github.com/apache/flink/pull/6688#issuecomment-420895049 @NicoK @pnowojski , this hotfix is mentioned in #6417 comments, and I submit it as a separate PR. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Make the condition of broadcast partitioner simple > -- > > Key: FLINK-10321 > URL: https://issues.apache.org/jira/browse/FLINK-10321 > Project: Flink > Issue Type: Improvement > Components: Network >Affects Versions: 1.7.0 >Reporter: zhijiang >Assignee: zhijiang >Priority: Minor > Labels: pull-request-available > > The current {{BroadcastPartitioner}} uses the vars of {{set}} and > {{setNumber}} as the condition for returning channel arrays. > Instead of using {{set}} and {{setNumber}}, we can just check whether > {{returnChannel.length == numberOfOutputChannels}} as the condition to make > it simple. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10321) Make the condition of broadcast partitioner simple
[ https://issues.apache.org/jira/browse/FLINK-10321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613059#comment-16613059 ] ASF GitHub Bot commented on FLINK-10321: zhijiangW opened a new pull request #6688: [FLINK-10321][network] Simplify the condition of BroadcastPartitioner URL: https://github.com/apache/flink/pull/6688 ## What is the purpose of the change The current `BroadcastPartitioner` uses the vars of `set` and `setNumber` as the condition for returning channel arrays. Instead of using `set` and `setNumber`, we can just check whether `returnArray.length == numberOfOutputChannels` as the condition to make it simple. ## Brief change log - *Remove the `set` and `setNumber` vars from `BroadcastPartitioner`* ## Verifying this change This change is already covered by existing tests. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? (no) - If yes, how is the feature documented? (not applicable) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Make the condition of broadcast partitioner simple > -- > > Key: FLINK-10321 > URL: https://issues.apache.org/jira/browse/FLINK-10321 > Project: Flink > Issue Type: Improvement > Components: Network >Affects Versions: 1.7.0 >Reporter: zhijiang >Assignee: zhijiang >Priority: Minor > Labels: pull-request-available > > The current {{BroadcastPartitioner}} uses the vars of {{set}} and > {{setNumber}} as the condition for returning channel arrays. > Instead of using {{set}} and {{setNumber}}, we can just check whether > {{returnChannel.length == numberOfOutputChannels}} as the condition to make > it simple. -- This message was sent by Atlassian JIRA (v7.6.3#76005)