Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 53880 invoked from network); 7 Oct 2010 15:44:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Oct 2010 15:44:25 -0000 Received: (qmail 8330 invoked by uid 500); 7 Oct 2010 15:44:25 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 8250 invoked by uid 500); 7 Oct 2010 15:44:24 -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 8242 invoked by uid 99); 7 Oct 2010 15:44:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 15:44:24 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jared.cantwell@gmail.com designates 74.125.82.176 as permitted sender) Received: from [74.125.82.176] (HELO mail-wy0-f176.google.com) (74.125.82.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 15:44:19 +0000 Received: by wye20 with SMTP id 20so188453wye.35 for ; Thu, 07 Oct 2010 08:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=O4XOiKX7n7T7aMSNxz0L1rRl9DDYmSadjBbYp2AuO4M=; b=KhUGkbSFZLd9CeYSNJkifvE/YHcIxUFKYaqcyTRcq1HzsumXqZp7hahxet5NWie16v 5KN3jJ7ZOaf8mQhkvp7uMuMW9tyggCNeJn/mZUAizi1Fc0UcUBmhgnY15/4JuBjmjE7V nqqBjRMa7EofVxRU9Z24ffv8lzCjWE2Fuiw4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=R+aJEkmX/l9bM6XuTSSDau6ygK7771muOjcSxb2yTuVsHaxQMqrJ30szXg+lguylv5 oyzaAlx6MJwWV/ZzXRMmN0NJDOPfEiz9/ieTICtH/B+kcIOXOJjTIHwcnVcuBdtb/8N9 uULCsB4eIsfOtoEWKeMbZknj4XOX93GM7J3Xg= Received: by 10.216.185.133 with SMTP id u5mr967332wem.11.1286466237431; Thu, 07 Oct 2010 08:43:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.59.13 with HTTP; Thu, 7 Oct 2010 08:43:37 -0700 (PDT) In-Reply-To: <4CADE8C4.9080805@darose.net> References: <4CABA4B5.8040700@darose.net> <4CADE8C4.9080805@darose.net> From: Jared Cantwell Date: Thu, 7 Oct 2010 11:43:37 -0400 Message-ID: Subject: Re: Create node with ancestors? To: zookeeper-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We just wrote a very simple helper method that splits the path up and creates each parent in the path. Its a total of 5 lines of code. This isn't as efficient as it can be though if you're doing it frequently (which we don't do), but it works for us. ~Jared On Thu, Oct 7, 2010 at 11:35 AM, David Rosenstrauch wro= te: > On 10/05/2010 06:20 PM, David Rosenstrauch wrote: >> >> The ZK "create" method explicitly states in the documentation "If the >> parent node does not exist in the ZooKeeper, a KeeperException with >> error code KeeperException.NoNode will be thrown." ( >> >> (http://hadoop.apache.org/zookeeper/docs/current/api/org/apache/zookeepe= r/ZooKeeper.html#create%28java.lang.String,%20byte[],%20java.util.List,%20o= rg.apache.zookeeper.CreateMode%29)) >> As a result, there doesn't appear to be any one single method call that >> can create a node, along with any missing parent nodes. This would be an >> incredibly useful API call, though, akin to HDFS' "mkdirs" method call. >> >> (http://hadoop.apache.org/common/docs/r0.20.1/api/org/apache/hadoop/fs/F= ileSystem.html#mkdirs%28org.apache.hadoop.fs.Path%29) >> >> >> Anybody know if there's a call like this available somewhere in the ZK >> API? >> >> Thanks, >> >> DR > > I guess that's a no. =A0:-( > > DR >