Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1DE5111790 for ; Mon, 16 Jun 2014 13:42:14 +0000 (UTC) Received: (qmail 71998 invoked by uid 500); 16 Jun 2014 13:42:13 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 71944 invoked by uid 500); 16 Jun 2014 13:42:13 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 71928 invoked by uid 99); 16 Jun 2014 13:42:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2014 13:42:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cf@renttherunway.com designates 209.85.215.43 as permitted sender) Received: from [209.85.215.43] (HELO mail-la0-f43.google.com) (209.85.215.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2014 13:42:08 +0000 Received: by mail-la0-f43.google.com with SMTP id e16so3005935lan.16 for ; Mon, 16 Jun 2014 06:41:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wbF8ZF72zO9JtGMT/kpZSbRiyYeDbApLnNDHglJnKaY=; b=m2Sq3pqbUZKWtKdDtpnP7wLGyzRy00gnWu1HXYsJwCzz0h1cJ0TDX5s9kH55w/SZCb 1EvE435Yjau8noNKmnOB/Kq131BSRIiRdhqoFZS5e/aQf/szKmHFJ2asQLVLbMN+klRx VS7Os0/KiayFZJUk6EOzC1aRz29o/pnw2gXtPYZQlU3rhS2XzTD1gqC2d4EytGkFkDM0 WoqjNBD6jEWKtiYxJ5/rF7cxK6BYviu6MYtL7GU/OdEga6Z8QW/9gu9EXMIkYPqCu0r2 HiBBxnVFnMt/nD4g1UVJ7QkO/RTdhyjV+GXkaRWB7+zxXV0syFt4vafa5acJGGLvz5G1 jGzw== X-Gm-Message-State: ALoCoQmuuD6IMSZW5Jsm1dT/Y/uvkWQUxZt1fWqL9HlY19RKoY6RMXssS+hIvwN56v7b+j3zLLIF MIME-Version: 1.0 X-Received: by 10.152.4.201 with SMTP id m9mr1932899lam.50.1402926106851; Mon, 16 Jun 2014 06:41:46 -0700 (PDT) Sender: cf@renttherunway.com Received: by 10.112.136.129 with HTTP; Mon, 16 Jun 2014 06:41:46 -0700 (PDT) Received: by 10.112.136.129 with HTTP; Mon, 16 Jun 2014 06:41:46 -0700 (PDT) In-Reply-To: References: <5B18D739-E881-408A-B5E1-B0F4DB7339B8@gmail.com> Date: Mon, 16 Jun 2014 09:41:46 -0400 X-Google-Sender-Auth: mtawo0WodMBpy4LNJlRqFYL2C0A Message-ID: Subject: Re: renaming a znode From: Camille Fournier To: "bookkeeper-user@zookeeper.apache.org" Cc: Mudit Verma Content-Type: multipart/alternative; boundary=089e013d1c4c3ed4bf04fbf430a7 X-Virus-Checked: Checked by ClamAV on apache.org --089e013d1c4c3ed4bf04fbf430a7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Just to clarify you mean the multi API? C On Jun 16, 2014 9:40 AM, "Jordan Zimmerman" wrote: > You could use the transaction api to create a new node and delete the old > node. > > -JZ > > > From: Mudit Verma mudit.f2004912@gmail.com > Reply: user@zookeeper.apache.org user@zookeeper.apache.org > Date: June 16, 2014 at 8:38:11 AM > To: user@zookeeper.apache.org user@zookeeper.apache.org > Subject: renaming a znode > > Hello People, > > Sorry for asking many questions these days. :) > > I am wondering if it is possible to rename a znode? I am building a > distributed map on top of zookeeper for special needs. From time to time,= I > need to freeze the map without restricting write access to the map. > > I plan to do it by maintaining two maps: > > map_current > map_frozen > > all the map entries are maintained as separate children znodes where key > is the name of the child node and value is the value stored on the child > node .. > for example /map_current/entry1(kv) > /map_current/entry2(kv) > > > Now at some point of time, I need to iterate the map while still allowing > write access by other clients. While I iterate, I don=E2=80=99t want othe= r clients > to see these entries. Once I process map_frozen entries I will delete the= m > (I don=E2=80=99t need them anymore) by just deleting the parent node. > > I plan to rename existing map from map_current to map_frozen and create > new map as map_current with empty data for further writes. Other clients > will continue to write new entries in map_current .. so on so forth .. > > Any suggestions on how can I do it efficiently. > > Thanks > Mudit --089e013d1c4c3ed4bf04fbf430a7--