Return-Path: X-Original-To: apmail-curator-user-archive@minotaur.apache.org Delivered-To: apmail-curator-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C2F611F46 for ; Fri, 16 May 2014 23:28:05 +0000 (UTC) Received: (qmail 49381 invoked by uid 500); 16 May 2014 22:51:23 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 21198 invoked by uid 500); 16 May 2014 22:38:37 -0000 Mailing-List: contact user-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@curator.apache.org Delivered-To: mailing list user@curator.apache.org Received: (qmail 45393 invoked by uid 99); 16 May 2014 22:20:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 22:20:34 +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: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.223.176] (HELO mail-ie0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 22:20:28 +0000 Received: by mail-ie0-f176.google.com with SMTP id rl12so90868iec.7 for ; Fri, 16 May 2014 15:20:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version:content-type; bh=MJthXk+XxWoNj5BKlPX/ZmqnOSCYHocpXFek3yyrErI=; b=AAib8vW45lj9Vnb0K84hX9kAQC6Sw0GJ2fCfTOteyfX5p3/2Vo5bHs8Qfp7t6Bt17z zvopbTZOpZiucX/cIafARkCDMUt4lOsfwizCmeE0foXIuKvEYsRXN7bePCvFS0S83cDH e6JAoCylepsdDAp1qjhiPjjwpODWf0gTZoKN9L+0gxED5bbh9QjU59YYmeSLix7IKVDT 6Hti1sj1RCW+yxjVpAhsActQGrAwkgzUqoqO1my1X05HKZChJ+/2W93pYrojt8zX89KL C8KMK3spw4c/uubV15P1DwXCYdLmVeeafOgNP3jJWsk7aWQ/yQQ5/bCZx6ZKorK9YgNA nckw== X-Gm-Message-State: ALoCoQkIEi4JiMPriDq9V2YewGB70VeIT29TSGeNEDZgym7rLa7/rhHdpJYD/K2hO475EIEdGRDv X-Received: by 10.42.35.15 with SMTP id o15mr41338icd.90.1400278807616; Fri, 16 May 2014 15:20:07 -0700 (PDT) Received: from Jordans-MacBook-Pro.local (cpe-0024a18b8095.cpe.cableonda.net. [190.219.168.35]) by mx.google.com with ESMTPSA id jf5sm816431igb.19.2014.05.16.15.20.06 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 15:20:07 -0700 (PDT) Date: Fri, 16 May 2014 17:19:50 -0500 From: Jordan Zimmerman To: Vadim Keylis , user@curator.apache.org Message-ID: In-Reply-To: References: Subject: Re: How to create znode with curator X-Mailer: Airmail (237) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="53768f15_1cf10fd8_20db" X-Virus-Checked: Checked by ClamAV on apache.org --53768f15_1cf10fd8_20db Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Use creatingParentsIfNeeded(). ZooKeeper does not automatically create pa= rent nodes. -JZ =46rom:=C2=A0Vadim Keylis vkeylis2009=40gmail.com Reply:=C2=A0user=40curator.apache.org user=40curator.apache.org Date:=C2=A0May 16, 2014 at 5:18:45 PM To:=C2=A0user=40curator.apache.org user=40curator.apache.org Subject:=C2=A0 Re: How to create znode with curator =20 When I run the code I get exception: org.apache.zookeeper.KeeperException=24NoNodeException: KeeperErrorCode =3D= NoNode for=C2=A0/name/offset/event-capture/topic at org.apache.zookeeper.KeeperException.create(KeeperException.java:111) at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783) at org.apache.curator.framework.imps.CreateBuilderImpl=2411.call(CreateBu= ilderImpl.java:676) On Thu, May 15, 2014 at 2:23 PM, Vadim Keylis w= rote: How do you create a path if it does not exist. Curator=46ramework =C2=A0 =C2=A0client =3D Curator=46ramework=46actory.ne= wClient(=22dzoo01:2181/kafka=22, new ExponentialBackoffRetry(1000, 3)); path=3D '/name/offset/event-capture/topic'; I check if path exists if(curator=46ramework.checkExists().forPath(path) =3D=3D null)=7B =C2=A0 =C2=A0=C2=A0curator=46ramework.create().forPath(path) =7D will that code snippet create znode=3F Thanks, Vadim=C2=A0 --53768f15_1cf10fd8_20db Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline