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 83E4C188A5 for ; Tue, 18 Aug 2015 02:01:46 +0000 (UTC) Received: (qmail 95397 invoked by uid 500); 18 Aug 2015 02:01:46 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 95300 invoked by uid 500); 18 Aug 2015 02:01:46 -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 95044 invoked by uid 99); 18 Aug 2015 02:01:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2015 02:01:46 +0000 Date: Tue, 18 Aug 2015 02:01:46 +0000 (UTC) From: "Yi Liu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-8912) Implement ShrinkableHashMap extends java HashMap and use properly 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-8912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yi Liu updated HDFS-8912: ------------------------- Description: Currently {{LightWeightHashSet}} and {{LightWeightLinkedSet}} are used in hdfs, there are two advantages compared to java HashSet: one is the entry requires fewer memory, another is it's shrinkable. In real cluster, hdfs is a long running service, and {{set}} may become large at some time and may become small after that, so shrinking the {{set}} when size hits the shrink threshold is necessary, it can improve the NN memory. Same situation for {{map}}, some HashMap used in BlockManager (e.g., the hashmap in CorruptReplicasMap), it's better to be shrinkable. I think it's worth to implement ShrinkableHashMap extends the java HashMap, for quick glance, seems few code is needed. was: Currently {{LightWeightHashSet}} and {{LightWeightLinkedSet}} are used in hdfs, there are two advantages compared to java HashSet: one is the entry requires fewer memory, another is it's shrinkable. In real cluster, hdfs is a long running service, and {{set}} may become very large at some time and may become small after that, so shrinking the {{set}} when size hits the shrink threshold is necessary, it can improve the NN memory. Same situation for {{map}}, some HashMap used in BlockManager (e.g., the hashmap in CorruptReplicasMap), it's better to be shrinkable. I think it's worth to implement ShrinkableHashMap extends the java HashMap, for quick glance, seems few code is needed. > Implement ShrinkableHashMap extends java HashMap and use properly > ----------------------------------------------------------------- > > Key: HDFS-8912 > URL: https://issues.apache.org/jira/browse/HDFS-8912 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Yi Liu > Assignee: Yi Liu > > Currently {{LightWeightHashSet}} and {{LightWeightLinkedSet}} are used in hdfs, there are two advantages compared to java HashSet: one is the entry requires fewer memory, another is it's shrinkable. In real cluster, hdfs is a long running service, and {{set}} may become large at some time and may become small after that, so shrinking the {{set}} when size hits the shrink threshold is necessary, it can improve the NN memory. > Same situation for {{map}}, some HashMap used in BlockManager (e.g., the hashmap in CorruptReplicasMap), it's better to be shrinkable. > I think it's worth to implement ShrinkableHashMap extends the java HashMap, for quick glance, seems few code is needed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)