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 1E21F200C1C for ; Wed, 1 Feb 2017 01:59:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1CAF0160B5F; Wed, 1 Feb 2017 00:59:13 +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 642A9160B52 for ; Wed, 1 Feb 2017 01:59:12 +0100 (CET) Received: (qmail 23640 invoked by uid 500); 1 Feb 2017 00:59:11 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 23629 invoked by uid 99); 1 Feb 2017 00:59:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2017 00:59:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 1F94F189AEB for ; Wed, 1 Feb 2017 00:59:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id qHNH5DleKBC3 for ; Wed, 1 Feb 2017 00:59:10 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 2AABA5F4EE for ; Wed, 1 Feb 2017 00:59:10 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1CB07E026F for ; Wed, 1 Feb 2017 00:58:53 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4DD332528A for ; Wed, 1 Feb 2017 00:58:52 +0000 (UTC) Date: Wed, 1 Feb 2017 00:58:52 +0000 (UTC) From: "Manoj Govindassamy (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11370) Optimize NamenodeFsck#getReplicaInfo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 01 Feb 2017 00:59:13 -0000 [ https://issues.apache.org/jira/browse/HDFS-11370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15847826#comment-15847826 ] Manoj Govindassamy commented on HDFS-11370: ------------------------------------------- Thanks [~tasanuma0829]. bq. I think it is the same risk as that of BlockUnderConstructionFeature#getExpectedStorageLocations() at least. {{BlockUnderConstructionFeature#getExpectedStorageLocations()}} and few other public methods in the same class work on the {{replicas}} array without proper synchronization but they never expose the cursor on the array to the caller. With {{getExpectedStorageLocationsIterator()}} we will be exposing a public iterator with the cursor exposed, but not thread safe. As a general practice, its advisable not to introduce any new non thread safe public iterators. One workaround here i can think of is, since the replicas is a very small array, we can have a copy of the replicas in the iterator at the time of construction and iterate over the same. Your thoughts please ? > Optimize NamenodeFsck#getReplicaInfo > ------------------------------------ > > Key: HDFS-11370 > URL: https://issues.apache.org/jira/browse/HDFS-11370 > Project: Hadoop HDFS > Issue Type: Improvement > Components: namenode > Reporter: Takanobu Asanuma > Assignee: Takanobu Asanuma > Priority: Minor > Attachments: HDFS-11370.1.patch, HDFS-11370.2.patch, HDFS-11370.3.patch, HDFS-11370.4.patch, HDFS-11370.5.patch > > > We can optimize the logic of calculating the number of storages in {{NamenodeFsck#getReplicaInfo}}. This is a follow-on task of HDFS-11124. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org