Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 45584 invoked from network); 4 May 2010 22:19:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 May 2010 22:19:09 -0000 Received: (qmail 73679 invoked by uid 500); 4 May 2010 22:19:09 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 73590 invoked by uid 500); 4 May 2010 22:19:09 -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 73578 invoked by uid 99); 4 May 2010 22:19:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 May 2010 22:19:09 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=MIME_QP_LONG_LINE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.145.54.172] (HELO mrout2.yahoo.com) (216.145.54.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 May 2010 22:19:01 +0000 Received: from SNV-EXPF01.ds.corp.yahoo.com (snv-expf01.ds.corp.yahoo.com [207.126.227.250]) by mrout2.yahoo.com (8.13.6/8.13.6/y.out) with ESMTP id o44MI8kD090987 for ; Tue, 4 May 2010 15:18:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=received:user-agent:date:subject:from:to:message-id: thread-topic:thread-index:in-reply-to:mime-version:content-type: content-transfer-encoding:x-originalarrivaltime; b=tE+S7Yb7P9Ynz5QSVmnPl47d8aG7USTpT/VdXyDfc9hcT75sTTXEoDiVzaxTahQ1 Received: from SNV-EXVS09.ds.corp.yahoo.com ([207.126.227.86]) by SNV-EXPF01.ds.corp.yahoo.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 4 May 2010 15:17:10 -0700 Received: from 10.73.146.106 ([10.73.146.106]) by SNV-EXVS09.ds.corp.yahoo.com ([207.126.227.84]) via Exchange Front-End Server snv-webmail.corp.yahoo.com ([207.126.227.59]) with Microsoft Exchange Server HTTP-DAV ; Tue, 4 May 2010 22:16:57 +0000 User-Agent: Microsoft-Entourage/12.24.0.100205 Date: Tue, 04 May 2010 15:16:56 -0700 Subject: Re: ZKClient From: Mahadev Konar To: Message-ID: Thread-Topic: ZKClient Thread-Index: Acrr14GzDOrX3FDNX0qhPOMNY5xAYw== In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable X-OriginalArrivalTime: 04 May 2010 22:17:10.0497 (UTC) FILETIME=[8A578D10:01CAEBD7] X-Virus-Checked: Checked by ClamAV on apache.org Hi Adam, I don't think zk is very very hard to get right. There are exmaples in src/recipes which implements locks/queues/others. There is ZOOKEEPER-22 to make it even more easier for application to use. Regarding re registration of watches, you can deifnitely write code and submit is as a part of well documented contrib module which lays out the assumptions/design of it. It could very well be useful for others. Its just that folks havent had much time to focus on these areas as yet. Thanks mahadev On 5/4/10 2:58 PM, "Adam Rosien" wrote: > I use zkclient in my work at kaChing and I have mixed feelings about > it. On one hand it makes "easy things easy" which is great, but on the > other hand I very few ideas what assumptions it makes "under the > hood". I also dislike some of the design choices such as unchecked > exceptions, but that's neither here nor there. It would take some > extensive documentation work by the authors to really enumerate the > model and assumptions, but the project doesn't seem to be active > (either from it being adequate for its current users or just > inactive). I'm not sure I could derive the assumptions myself. >=20 > I'm a bit frustrated that zk is "very, very hard to really get right". > At a project level, can't we create structures to avoid most of these > errors? Can there be a "standard model" with detailed assumptions and > implementations of all the recipes? How can we start this? Is there > something that makes this too hard? >=20 > I feel like a recipe page is a big fail; wouldn't an example app that > uses locks and barriers be that much more compelling? >=20 > For the common FAQ items like "you need to re-register the watch", > can't we just create code that implements this pattern? My goal is to > live up to the motto: a good API is impossible to use incorrectly. >=20 > .. Adam >=20 > On Tue, May 4, 2010 at 2:21 PM, Ted Dunning wrote= : >> In general, writing this sort of layer on top of ZK is very, very hard t= o >> get really right for general use. =A0In a simple use-case, you can probabl= y >> nail it but distributed systems are a Zoo, to coin a phrase. =A0The proble= m is >> that you are fundamentally changing the metaphors in use so assumptions = can >> come unglued or be introduced pretty easily. >>=20 >> One example of this is the fact that ZK watches *don't* fire for every >> change but when you write listener oriented code, you kind of expect tha= t >> they will. =A0That makes it really, really easy to introduce that assumpti= on >> in the heads of the programmer using the event listener library on top o= f >> ZK. =A0Another example is how the atomic get content/set watch call works = in >> ZK is easy to violate in an event driven architecture because the thread >> that watches ZK probably resets the watch. =A0If you assume that the liste= ner >> will read the data, then you have introduced a timing mismatch between t= he >> read of the data and the resetting of the watch. =A0That might be OK or it >> might not be. =A0The point is that these changes are subtle and tricky to = get >> exactly right. >>=20 >> On Tue, May 4, 2010 at 1:48 PM, Jonathan Holloway < >> jonathan.holloway@gmail.com> wrote: >>=20 >>> Is there any reason why this isn't part of the Zookeeper trunk already? >>>=20 >>=20