Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3A917200C5B for ; Thu, 27 Apr 2017 16:49:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3934C160BB5; Thu, 27 Apr 2017 14:49:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8B564160BB2 for ; Thu, 27 Apr 2017 16:49:52 +0200 (CEST) Received: (qmail 53370 invoked by uid 500); 27 Apr 2017 14:49:51 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 53281 invoked by uid 99); 27 Apr 2017 14:49:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2017 14:49:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 84655E01BC; Thu, 27 Apr 2017 14:49:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aljoscha@apache.org To: commits@flink.apache.org Date: Thu, 27 Apr 2017 14:49:52 -0000 Message-Id: In-Reply-To: <951d9a6c0248464483107630a7feac00@git.apache.org> References: <951d9a6c0248464483107630a7feac00@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/4] flink git commit: [hotfix][metrics] remove an unnecessary check for non-null archived-at: Thu, 27 Apr 2017 14:49:53 -0000 [hotfix][metrics] remove an unnecessary check for non-null The metrics group given to a Task must always be non-null otherwise the code would have crashed anyway. Similarly, the group returned by getIOMetricGroup() is always present. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/931ce05a Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/931ce05a Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/931ce05a Branch: refs/heads/master Commit: 931ce05a47ce1063c056c1a558a974fbce559f41 Parents: 6cba8bb Author: Nico Kruber Authored: Mon Feb 27 11:14:35 2017 +0100 Committer: Aljoscha Krettek Committed: Thu Apr 27 15:14:09 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/flink/runtime/taskmanager/Task.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/931ce05a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java index f3dacc3..5a402fd 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java @@ -74,6 +74,7 @@ import org.apache.flink.util.SerializedValue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.IOException; import java.net.URL; @@ -280,7 +281,7 @@ public class Task implements Runnable, TaskActions { LibraryCacheManager libraryCache, FileCache fileCache, TaskManagerRuntimeInfo taskManagerConfig, - TaskMetricGroup metricGroup, + @Nonnull TaskMetricGroup metricGroup, ResultPartitionConsumableNotifier resultPartitionConsumableNotifier, PartitionProducerStateChecker partitionProducerStateChecker, Executor executor) { @@ -408,10 +409,8 @@ public class Task implements Runnable, TaskActions { // finally, create the executing thread, but do not start it executingThread = new Thread(TASK_THREADS_GROUP, this, taskNameWithSubtask); - if (this.metrics != null && this.metrics.getIOMetricGroup() != null) { - // add metrics for buffers - this.metrics.getIOMetricGroup().initializeBufferMetrics(this); - } + // add metrics for buffers + this.metrics.getIOMetricGroup().initializeBufferMetrics(this); } // ------------------------------------------------------------------------