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 2019/05/15 06:34:04 UTC
[flink] 01/04: [hotfix][metrics] Exit early if not reporters are
configured
This is an automated email from the ASF dual-hosted git repository.
chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 7534b6c4bdfc3d14a6a50ddc96bc3f646a11bff1
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Thu Apr 18 14:43:56 2019 +0200
[hotfix][metrics] Exit early if not reporters are configured
---
.../apache/flink/runtime/metrics/ReporterSetup.java | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/ReporterSetup.java b/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/ReporterSetup.java
index 1d0c537..b6d3827 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/ReporterSetup.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/ReporterSetup.java
@@ -131,20 +131,18 @@ public final class ReporterSetup {
}
}
- List<Tuple2<String, Configuration>> reporterConfigurations;
-
if (namedReporters.isEmpty()) {
- reporterConfigurations = Collections.emptyList();
- } else {
- reporterConfigurations = new ArrayList<>(namedReporters.size());
+ return Collections.emptyList();
+ }
- for (String namedReporter: namedReporters) {
- DelegatingConfiguration delegatingConfiguration = new DelegatingConfiguration(
- configuration,
- ConfigConstants.METRICS_REPORTER_PREFIX + namedReporter + '.');
+ List<Tuple2<String, Configuration>> reporterConfigurations = new ArrayList<>(namedReporters.size());
- reporterConfigurations.add(Tuple2.of(namedReporter, (Configuration) delegatingConfiguration));
- }
+ for (String namedReporter: namedReporters) {
+ DelegatingConfiguration delegatingConfiguration = new DelegatingConfiguration(
+ configuration,
+ ConfigConstants.METRICS_REPORTER_PREFIX + namedReporter + '.');
+
+ reporterConfigurations.add(Tuple2.of(namedReporter, (Configuration) delegatingConfiguration));
}
List<ReporterSetup> reporterArguments = new ArrayList<>(reporterConfigurations.size());