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 660B1200D08 for ; Thu, 21 Sep 2017 15:48:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6498C1609D0; Thu, 21 Sep 2017 13:48:19 +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 AA7391609B8 for ; Thu, 21 Sep 2017 15:48:18 +0200 (CEST) Received: (qmail 45115 invoked by uid 500); 21 Sep 2017 13:48:17 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 45106 invoked by uid 99); 21 Sep 2017 13:48:17 -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, 21 Sep 2017 13:48:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A8D55F5674; Thu, 21 Sep 2017 13:48:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kihwal@apache.org To: common-commits@hadoop.apache.org Message-Id: <9ae2d4ee34b74b0382a8f3157f095a0b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDFS-12371. BlockVerificationFailures and BlocksVerified show up as 0 in Datanode JMX. Contributed by Hanisha Koneru. Date: Thu, 21 Sep 2017 13:48:17 +0000 (UTC) archived-at: Thu, 21 Sep 2017 13:48:19 -0000 Repository: hadoop Updated Branches: refs/heads/branch-2 ae42bf73c -> 9640bfb80 HDFS-12371. BlockVerificationFailures and BlocksVerified show up as 0 in Datanode JMX. Contributed by Hanisha Koneru. (cherry picked from commit 6bf921a5c3152a307b5c0903056d73ce07775a08) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9640bfb8 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9640bfb8 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9640bfb8 Branch: refs/heads/branch-2 Commit: 9640bfb808b65e8a64b4886829b8d519ddf437c1 Parents: ae42bf7 Author: Kihwal Lee Authored: Thu Sep 21 08:48:04 2017 -0500 Committer: Kihwal Lee Committed: Thu Sep 21 08:48:04 2017 -0500 ---------------------------------------------------------------------- .../org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/9640bfb8/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java index 05a75d5..b530536 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java @@ -37,6 +37,7 @@ import org.apache.hadoop.hdfs.server.datanode.BlockScanner.Conf; import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeReference; import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi.BlockIterator; import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi; +import org.apache.hadoop.hdfs.server.datanode.metrics.DataNodeMetrics; import org.apache.hadoop.hdfs.util.DataTransferThrottler; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.util.Time; @@ -81,6 +82,8 @@ public class VolumeScanner extends Thread { */ private final DataNode datanode; + private final DataNodeMetrics metrics; + /** * A reference to the volume that we're scanning. */ @@ -300,6 +303,7 @@ public class VolumeScanner extends Thread { VolumeScanner(Conf conf, DataNode datanode, FsVolumeReference ref) { this.conf = conf; this.datanode = datanode; + this.metrics = datanode.getMetrics(); this.ref = ref; this.volume = ref.getVolume(); ScanResultHandler handler; @@ -444,12 +448,14 @@ public class VolumeScanner extends Thread { throttler.setBandwidth(bytesPerSec); long bytesRead = blockSender.sendBlock(nullStream, null, throttler); resultHandler.handle(block, null); + metrics.incrBlocksVerified(); return bytesRead; } catch (IOException e) { resultHandler.handle(block, e); } finally { IOUtils.cleanup(null, blockSender); } + metrics.incrBlockVerificationFailures(); return -1; } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org