Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 29705 invoked from network); 30 Mar 2010 01:55:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Mar 2010 01:55:06 -0000 Received: (qmail 9267 invoked by uid 500); 30 Mar 2010 01:55:06 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 9246 invoked by uid 500); 30 Mar 2010 01:55:06 -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 9238 invoked by uid 99); 30 Mar 2010 01:55:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Mar 2010 01:55:06 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=AWL,HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_FROM_MISSPACED X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zd.wbh@163.com designates 220.181.12.15 as permitted sender) Received: from [220.181.12.15] (HELO m12-15.163.com) (220.181.12.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Mar 2010 01:54:58 +0000 Received: from zd.wbh (unknown [60.191.86.3]) by smtp11 (Coremail) with SMTP id D8CowLBrjQXgWbFLZlc1AA--.15449S2; Tue, 30 Mar 2010 09:54:40 +0800 (CST) Date: Tue, 30 Mar 2010 09:54:30 +0800 From: "zd.wbh" To: "zookeeper-user" Message-ID: <1810056716.69201.1269914075988.JavaMail.zd.wbh@163.com> Subject: How to ensure trasaction create-and-update MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="__=_Part_Boundary_004_008248.008883" X-Mailer: NetEase Flash Mail 2.0.0.70Beta X-Priority: 3 (Normal) X-CM-TRANSID: D8CowLBrjQXgWbFLZlc1AA--.15449S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw1rGF17XFyUuw4Utw13Arb_yoWxCrX_Wr 4xur4vyw1UK39Yqw45Jr1a9FZY9rZrC3s8JrWrtFWjq39rJrWkArZ7Gr9IkFsrZw4DJr13 KwnFgw13Z3WSyjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRC5l8UUUUUU== X-CM-SenderInfo: l2go4urk6rljoofrz/1tbiVgaj4UgYuaJlNwAAsL --__=_Part_Boundary_004_008248.008883 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit hiļ¼Œall we'd like to store some metadata in zookeeper in our upcoming project, here is a special but common case: we need to create a new znode, in the mean while, update another znode data. These manipulation(a create and a update) need to be done as atom. We don't want to see a successful creation and a failure updating. Is there a convenient way to ensure this operation? Can you give me some tips? I've looked into the src code, there is a tedious way to do. Extend zookeeper instruction, struct a "createAndUpdate" interface and a txn request, let DataTree to ensure the integrity. Will this do and the only way? Thanks a lot for all your attention. 2010-03-30 Will --__=_Part_Boundary_004_008248.008883--