Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@locus.apache.org Received: (qmail 5051 invoked from network); 12 Dec 2008 19:37:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2008 19:37:18 -0000 Received: (qmail 86498 invoked by uid 500); 12 Dec 2008 19:37:30 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 86475 invoked by uid 500); 12 Dec 2008 19:37:30 -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 86460 invoked by uid 99); 12 Dec 2008 19:37:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 11:37:30 -0800 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.172] (HELO mrout2.yahoo.com) (216.145.54.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 19:37:16 +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 mBCJafVn053888; Fri, 12 Dec 2008 11:36:41 -0800 (PST) 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:return-path:x-originalarrivaltime; b=2Tojn6c+mHdpiO/8gSRc/r3HahI0oBUdUMpIcIKC7zAZFFJtXFpUgu6Fsm/JgY/F Received: from SNV-EXVS07.ds.corp.yahoo.com ([207.126.227.6]) by SNV-EXPF01.ds.corp.yahoo.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 12 Dec 2008 11:36:41 -0800 Received: from 10.72.182.90 ([10.72.182.90]) by SNV-EXVS07.ds.corp.yahoo.com ([207.126.227.142]) with Microsoft Exchange Server HTTP-DAV ; Fri, 12 Dec 2008 19:36:40 +0000 User-Agent: Microsoft-Entourage/12.14.0.081024 Date: Fri, 12 Dec 2008 11:36:40 -0800 Subject: Re: zoo_set() version question From: Avery Ching To: Patrick Hunt , Message-ID: Thread-Topic: zoo_set() version question Thread-Index: AclckPRFr3HvlR+VJUu8SnKERsvf4w== In-Reply-To: <4942B745.5060608@apache.org> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-OriginalArrivalTime: 12 Dec 2008 19:36:41.0754 (UTC) FILETIME=[F550F7A0:01C95C90] X-Virus-Checked: Checked by ClamAV on apache.org Patrick, Thanks for responding. I agree that I can use zoo_exists and zoo_get to get the version of the znode as it exists currently. The problem I am trying to solve is that getting the version from struct Stat in either zoo_exists or zoo_get may not be the same version that my last successful zoo_set used. I would like to get the version that denotes my last successful zoo_set() operation to a particular znode. I understand that the data and version to the znode may change immediately one or multiple times after my zoo_set() and this is fine, but I would still like to know the znode's versions of the data I set. Avery On 12/12/08 11:11 AM, "Patrick Hunt" wrote: > Avery Ching wrote: >> If zoo_set() completes successfully with version != -1, can we assume that >> version -> version + 1 for this znode? If not, is there a way for the user >> to get the version of the successfully completed zoo_set() operation? > > You shouldn't rely on this, it may work, but it's not part of the > contract. Also, nothing says that some other client won't change the > node immediately after you change it. > > You can access the version using zoo_exists or zoo_get - specifically > the "struct Stat stat" argument of either of those methods contains a > "version" member. > > Patrick