Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C49618B40 for ; Wed, 24 Feb 2016 23:09:25 +0000 (UTC) Received: (qmail 75767 invoked by uid 500); 24 Feb 2016 23:09:18 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 75628 invoked by uid 500); 24 Feb 2016 23:09:18 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 75322 invoked by uid 99); 24 Feb 2016 23:09:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 23:09:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 3BF7D2C1F68 for ; Wed, 24 Feb 2016 23:09:18 +0000 (UTC) Date: Wed, 24 Feb 2016 23:09:18 +0000 (UTC) From: "Kai Zheng (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-9734) Refactoring of checksum failure report related codes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15166039#comment-15166039 ] Kai Zheng commented on HDFS-9734: --------------------------------- bq. One nit is that getCorruptedMap should be getCorruptionMap Right exactly. Thanks for the update, Zhe! > Refactoring of checksum failure report related codes > ---------------------------------------------------- > > Key: HDFS-9734 > URL: https://issues.apache.org/jira/browse/HDFS-9734 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Kai Zheng > Assignee: Kai Zheng > Attachments: HADOOP-12744-v1.patch, HADOOP-12744-v2.patch, HDFS-9734-v3.patch, HDFS-9734-v4.patch, HDFS-9734-v5.patch, HDFS-9734-v6.patch, HDFS-9734-v7.patch, HDFS-9734-v8.patch > > > This was from discussion with [~jingzhao] in HDFS-9646. There is some duplicate codes between client and datanode sides: > {code} > private void addCorruptedBlock(ExtendedBlock blk, DatanodeInfo node, > Map> corruptionMap) { > Set dnSet = corruptionMap.get(blk); > if (dnSet == null) { > dnSet = new HashSet<>(); > corruptionMap.put(blk, dnSet); > } > if (!dnSet.contains(node)) { > dnSet.add(node); > } > } > {code} > This would resolve the duplication and also simplify the codes some bit. -- This message was sent by Atlassian JIRA (v6.3.4#6332)