Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 38757 invoked from network); 8 May 2009 20:03:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 May 2009 20:03:03 -0000 Received: (qmail 92133 invoked by uid 500); 8 May 2009 20:03:03 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 92111 invoked by uid 500); 8 May 2009 20:03:03 -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 92101 invoked by uid 99); 8 May 2009 20:03:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 20:03:03 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.145.54.173] (HELO mrout3.yahoo.com) (216.145.54.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 20:02:51 +0000 Received: from [10.72.76.26] (snvvpn2-10-72-76-c26.hq.corp.yahoo.com [10.72.76.26]) by mrout3.yahoo.com (8.13.6/8.13.6/y.out) with ESMTP id n48K1NX3008849 for ; Fri, 8 May 2009 13:01:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: references:in-reply-to:content-type:content-transfer-encoding; b=Tyr93JXfZnyqOBycrcutB5Fk+Tl6NF5OZUu0ShRj9KlSOjPcV6InSk+58MCly7tS Message-ID: <4A048F93.1000309@yahoo-inc.com> Date: Fri, 08 May 2009 13:01:23 -0700 From: Benjamin Reed User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: "zookeeper-user@hadoop.apache.org" Subject: Re: NodeChildrenChanged WatchedEvent 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 i'm adding a faq on this right now. it's a rather common request. we could put in the name of the node that is changing. indeed, we did in the first cut of zookeeper, but then we found that every instance of programs that used this resulted in bugs, so we removed it. here is the problem: you do a getChildren(), an event comes in that "foo" is deleted, and right afterwords "goo" gets deleted, but you aren't going to get that event since the previous delete fired and you haven't done another getChildren(). this almost always results in an error, so much so that we don't even give people the rope. ben Javier Vegas wrote: > Hi, I am starting to implement Zookeeper as an arbiter for a high > performance client-server service, it is working really well but I > have a question. When my Watcher receives an event of > NodeChildrenChanged event, is there any way of getting from the event > the path for the child that changed? The WatchedEvent javadoc says > that it "includes exactly what happened" but all I am able to extract > is a vague "NodeChildrenChanged" type. What I am doing now to figure > out the path of teh new child is to do a new getChildren and compare > the new children list with the old children list, but that seems a > waste of time and bandwith if my node has lots of children and is > watched by a loot of zookeepers (which will be in prod). If I can > somehow get the path of the added/deleted child from the > WatchedEvent, it will make my life easier and my Zookeeper-powered > system much more simple, robust and scalable. Any suggestions? > > Thanks, > > Javier Vegas >