Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 13968 invoked from network); 14 Jul 2009 21:15:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jul 2009 21:15:41 -0000 Received: (qmail 15738 invoked by uid 500); 14 Jul 2009 21:15:50 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 15708 invoked by uid 500); 14 Jul 2009 21:15:50 -0000 Mailing-List: contact zookeeper-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-user@hadoop.apache.org Delivered-To: mailing list zookeeper-user@hadoop.apache.org Received: (qmail 15694 invoked by uid 99); 14 Jul 2009 21:15:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2009 21:15:50 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [207.126.228.150] (HELO rsmtp2.corp.yahoo.com) (207.126.228.150) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2009 21:15:39 +0000 Received: from [172.21.148.113] (nat-dip10.cfw-b-gci.corp.yahoo.com [209.131.62.145]) (authenticated bits=0) by rsmtp2.corp.yahoo.com (8.13.8/8.13.8/y.rout) with ESMTP id n6ELFDIm038630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Jul 2009 14:15:13 -0700 (PDT) Message-ID: <4A5CF561.8020806@apache.org> Date: Tue, 14 Jul 2009 14:15:13 -0700 From: Patrick Hunt User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: zookeeper-user@hadoop.apache.org Subject: Re: Instantiating HashSet for DataNode? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Erik, if you'd like enter a JIRA and take a whack at it go ahead. Perhaps a subclass of DataNode specific for ephemerals? That way it can handle any particulars - and should also minimize the number of "if(children==null)" type checks that would be needed. (don't neg. impact performance or b/w compat though). You would probably learn more about zk internals, testing, etc... in the process. http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute Patrick Mahadev Konar wrote: > Hi Erik, > I am not sure if that would a considerable opitmization but even if you > wanted to do it, it would be much more than just adding a check in the > constructor (the serialization/deserialization would need to have > specialized code). Right now all the datanodes are treated equally for > ser/derser and other purposes. > > > mahadev > > > > > On 7/14/09 1:42 PM, "Erik Holstad" wrote: > >> I'm not sure if I've miss read the code for the DataNode, but to me it looks >> like every node gets a set of children even though it might be an >> ephemeral node which cannot have children, so we are wasting 240 B for every >> one of those. Not sure if it makes a big difference, but just thinking >> that since everything sits in memory and there is no reason to instantiate >> it, maybe it would be possible just to add a check in the constructor? >> >> Regards Erik >