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 D7B0717E6E for ; Fri, 1 May 2015 19:05:08 +0000 (UTC) Received: (qmail 92079 invoked by uid 500); 1 May 2015 19:05:08 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 91976 invoked by uid 500); 1 May 2015 19:05:08 -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 91867 invoked by uid 99); 1 May 2015 19:05:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2015 19:05:08 +0000 Date: Fri, 1 May 2015 19:05:08 +0000 (UTC) From: "Colin Patrick McCabe (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-7758) Retire FsDatasetSpi#getVolumes() and use FsDatasetSpi#getVolumeRefs() instead 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-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14523713#comment-14523713 ] Colin Patrick McCabe commented on HDFS-7758: -------------------------------------------- Thanks, [~eddyxu]. Looks good overall. Given that we have a class named {{FsVolumeReference}}, we should consistently refer to "Volume references" rather than "referred volumes" So let's change {{ReferredFsVolumes}} -> {{FsVolumeReferences}}. It would be nice to avoid all the typecasts. I think we can, if we change FsVolumeReference -> FsVolumeReference and FsVolumeReferences -> FsVolumeReferences. But let's do that in a follow-on change-- this change is big enough already. {{FsDatasetImpl#volumes}} is still package-private rather than truly private. Can you make it private? Otherwise other code in this package can reach in and use this field directly. I also think we should just get rid of {{FsDatasetImpl#getVolumes}}... objects don't need to use accessors for private internal fields. As long as that function exists there will be a temptation to make it more accessible, like has happened with many other accessors in the past. > Retire FsDatasetSpi#getVolumes() and use FsDatasetSpi#getVolumeRefs() instead > ----------------------------------------------------------------------------- > > Key: HDFS-7758 > URL: https://issues.apache.org/jira/browse/HDFS-7758 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Affects Versions: 2.6.0 > Reporter: Lei (Eddy) Xu > Assignee: Lei (Eddy) Xu > Attachments: HDFS-7758.000.patch, HDFS-7758.001.patch, HDFS-7758.002.patch, HDFS-7758.003.patch, HDFS-7758.004.patch, HDFS-7758.005.patch, HDFS-7758.006.patch > > > HDFS-7496 introduced reference-counting the volume instances being used to prevent race condition when hot swapping a volume. > However, {{FsDatasetSpi#getVolumes()}} can still leak the volume instance without increasing its reference count. In this JIRA, we retire the {{FsDatasetSpi#getVolumes()}} and propose {{FsDatasetSpi#getVolumeRefs()}} and etc. method to access {{FsVolume}}. Thus it makes sure that the consumer of {{FsVolume}} always has correct reference count. -- This message was sent by Atlassian JIRA (v6.3.4#6332)