You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2017/05/19 21:10:04 UTC
[3/5] flink git commit: [FLINK-6586] InputGateMetrics return 0 as min
for local channels
[FLINK-6586] InputGateMetrics return 0 as min for local channels
This closes #3907.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/17ec6f02
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/17ec6f02
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/17ec6f02
Branch: refs/heads/master
Commit: 17ec6f020b779efe9152456f4ef33f6f802e4f67
Parents: fadc026
Author: zentol <ch...@apache.org>
Authored: Mon May 15 13:56:06 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Fri May 19 21:08:34 2017 +0200
----------------------------------------------------------------------
.../io/network/partition/consumer/InputGateMetrics.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/17ec6f02/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
index 796a6db..69af455 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java
@@ -72,10 +72,6 @@ public class InputGateMetrics {
int min = Integer.MAX_VALUE;
Collection<InputChannel> channels = inputGate.getInputChannels().values();
- if (channels.isEmpty()) {
- // meaningful value when no channels exist:
- return 0;
- }
for (InputChannel channel : channels) {
if (channel instanceof RemoteInputChannel) {
@@ -86,6 +82,9 @@ public class InputGateMetrics {
}
}
+ if (min == Integer.MAX_VALUE) { // in case all channels are local, or the channel collection was empty
+ return 0;
+ }
return min;
}