Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 71001 invoked from network); 29 Jun 2010 13:15:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Jun 2010 13:15:03 -0000 Received: (qmail 13099 invoked by uid 500); 29 Jun 2010 13:15:03 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 12799 invoked by uid 500); 29 Jun 2010 13:15:00 -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 12732 invoked by uid 99); 29 Jun 2010 13:14:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jun 2010 13:14:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aoriani@gmail.com designates 209.85.210.48 as permitted sender) Received: from [209.85.210.48] (HELO mail-pz0-f48.google.com) (209.85.210.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jun 2010 13:14:51 +0000 Received: by pzk35 with SMTP id 35so622443pzk.35 for ; Tue, 29 Jun 2010 06:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=7sKZB5xZyDQkzx5nI2MZHlNiky0dKz5Yz3VDGL/dW0Q=; b=Xjljr6bkuNARHv67PS6oWW02aTc20FfN5pjO5wOB0Ma29oepa9M3QrhEitZndLGAas nlaMH8Wb6hyJyJxJYQDHYJ9Qa7DznzIgK2XJwnfMb2DT4BXnxgoaq+kViYozaHonLgOF rmCmv62wHxY/dBrMW/D3X5Kk+UT2dFqkKbCak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=DQctwW+LsI5p57vAHDPTVeesC5vER2fbAAc0dXPLYSNFuX+wjCiT6e1bRBf8ycEUKx J23/32GYz0RYeA0dDatzeqh6JiHvo0MgUi7DRQ5ToyPccLHYAXiHDpVk9PAHTvSteVL4 00X5+4wgnT3ozZ7Y+8PoOAGMSKBOOIQSYcJj4= Received: by 10.142.215.19 with SMTP id n19mr5149208wfg.228.1277817205972; Tue, 29 Jun 2010 06:13:25 -0700 (PDT) MIME-Version: 1.0 Sender: aoriani@gmail.com Received: by 10.151.110.13 with HTTP; Tue, 29 Jun 2010 06:13:05 -0700 (PDT) From: =?ISO-8859-1?Q?Andr=E9_Oriani?= Date: Tue, 29 Jun 2010 10:13:05 -0300 X-Google-Sender-Auth: ARZXEgzy7x6FGjoQo-___iHfgPg Message-ID: Subject: Are Watchers execute sequentially or in parallel ? To: zookeeper-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=000e0cd327f2a7c37c048a2b002b X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd327f2a7c37c048a2b002b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Are Watchers executed sequentially or in parallel ? Suppose I want to monitor the children of a znode for any modification. I don't want the sam= e watcher to be re-executed while it is still executing. 1) public class ChildrenWatcher implements Watcher{ public void process(WatchedEvent event) { //get children and install watcher List children =3D zk.getChildren(path, this); //process children } } 2) public class ChildrenWatcher implements Watcher{ public void process(WatchedEvent event) { //get children List children =3D zk.getChildren(path, null); //process children //install watcher zk.getChildren(path, null) } } Does both code achieve the goal or just the code number 2 ? Tks, Andr=E9 --000e0cd327f2a7c37c048a2b002b--