From hdfs-issues-return-267631-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Jun 14 03:03:03 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id D749C18064E for ; Fri, 14 Jun 2019 05:03:02 +0200 (CEST) Received: (qmail 38090 invoked by uid 500); 14 Jun 2019 03:03:02 -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 38077 invoked by uid 99); 14 Jun 2019 03:03:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2019 03:03:01 +0000 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 57147E2CDF for ; Fri, 14 Jun 2019 03:03:01 +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 D515E245A4 for ; Fri, 14 Jun 2019 03:03:00 +0000 (UTC) Date: Fri, 14 Jun 2019 03:03:00 +0000 (UTC) From: "Jinglun (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-14547) DirectoryWithQuotaFeature.quota costs additional memory even the storage type quota is not set. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-14547?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jinglun updated HDFS-14547: --------------------------- Attachment: (was: HDFS-14547-Test Report.pdf) > DirectoryWithQuotaFeature.quota costs additional memory even the storage = type quota is not set. > -------------------------------------------------------------------------= ---------------------- > > Key: HDFS-14547 > URL: https://issues.apache.org/jira/browse/HDFS-14547 > Project: Hadoop HDFS > Issue Type: Improvement > Affects Versions: 3.1.0 > Reporter: Jinglun > Assignee: Jinglun > Priority: Major > Attachments: HDFS-14547-design, HDFS-14547-patch003-Test Report.p= df, HDFS-14547.001.patch, HDFS-14547.002.patch > > > Our XiaoMi HDFS is considering upgrading from 2.6 to 3.1. We notice the s= torage type quota 'tsCounts' is instantiated to EnumCounters(S= torageType.class), so it will cost a long[5] even if we don't have any stor= age type quota on this inode(only space quota or name quota). > In our cluster we have many dirs with quota and the NameNode's memory is = in tension, so the additional cost will be a problem. > See=C2=A0DirectoryWithQuotaFeature.Builder(). > =C2=A0 > {code:java} > class DirectoryWithQuotaFeature$Builder { > public Builder() { > this.quota =3D new QuotaCounts.Builder().nameSpace(DEFAULT_NAMESPACE_Q= UOTA). > storageSpace(DEFAULT_STORAGE_SPACE_QUOTA). > typeSpaces(DEFAULT_STORAGE_SPACE_QUOTA).build();// set default value -= 1. > this.usage =3D new QuotaCounts.Builder().nameSpace(1).build(); > } > public Builder typeSpaces(long val) {// set default value. > this.tsCounts.reset(val); > return this; > } > } > class QuotaCounts$Builder { > public Builder() { > this.nsSsCounts =3D new EnumCounters(Quota.class); > this.tsCounts =3D new EnumCounters(StorageType.class); > } > } > class EnumCounters { > public EnumCounters(final Class enumClass) { > final E[] enumConstants =3D enumClass.getEnumConstants(); > Preconditions.checkNotNull(enumConstants); > this.enumClass =3D enumClass; > this.counters =3D new long[enumConstants.length];// new a long array = here. > } > } > {code} > Related to HDFS-14542. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org