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 05C78181F1 for ; Wed, 9 Mar 2016 17:45:00 +0000 (UTC) Received: (qmail 47329 invoked by uid 500); 9 Mar 2016 17:44:59 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 47255 invoked by uid 500); 9 Mar 2016 17:44:59 -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 47244 invoked by uid 99); 9 Mar 2016 17:44:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2016 17:44:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 38A0BC0EB1 for ; Wed, 9 Mar 2016 17:44:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=jordanzimmerman-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 1KqDG2JFwk0i for ; Wed, 9 Mar 2016 17:44:58 +0000 (UTC) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 918A45F33D for ; Wed, 9 Mar 2016 17:44:57 +0000 (UTC) Received: by mail-pf0-f179.google.com with SMTP id 129so46245162pfw.1 for ; Wed, 09 Mar 2016 09:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jordanzimmerman-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Dgm/BnyGmy3Uzzsr6GwqVdMpzrr4kTOqwFGbgF76Nco=; b=dwxApagxmfUJRTXmn/QG6o9VTeNCbTwM6d9XzZzQdsmyyjrJHtaTRILP4xN24Y+ewp 3Tdh5uELDxObg0N/0Mk9tgKHo+kMRYBIcwfK306lr5FdX34OUL83wZ4dCUykpTfUhH9e jbqVT68CjAW26uXtj9mE0sFg78ly7OfeMEab/cETytpWGwerOrb6SvtWiqu34IuycgXG fDkpzUcntRO+/LaD96dHvkoQe0dnirnnWyMKHXQfAJbJRjktmwRWpGud58G5EnvSnge2 t6rAk21Wf3AnvMa69gGz3EMviQVg3S8F4YG20SBd2uqmLfgNHy2OxFAP+XNzfKojq6cH S8Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Dgm/BnyGmy3Uzzsr6GwqVdMpzrr4kTOqwFGbgF76Nco=; b=lKWdnmht4vm8YHT9TUilS/4yarX8aEL2plQ8inYc1gsBMEJ2dnWoQ0twnxfEzFwqSk CB3fybVoScTypc5LRA3E+ACcl77CzcvULhXEmV1riAMlEPjkjvVzH26+Rf6k+t0kqhHu W3nObVO6zeUtQ1CZ4j0xQxBOM78nxcpz1zVZPNS5UQ9WWIITAY7rG4K/MY0VWX5jXC3C rbPQIQyJ0wGark/gvnLq/Vk6OVyBpmrlWGHKC1y4BqWboPHtFHDXkkYCUZZBtQ3qTEr/ 6w7di2HwzDEy7MaBJeYgcMjsN7y7+aV8OzkpQzGCXINk0XLc6oC2DUZ7OP2+yXSuy46P rtbA== X-Gm-Message-State: AD7BkJIz0U4nfgkzQdO5DuxAWWdrY1C0wr5dmncc2U8ZlV4QggUXNiiB2kKgFR5GpkN1Yg== X-Received: by 10.98.68.209 with SMTP id m78mr34268420pfi.153.1457545496428; Wed, 09 Mar 2016 09:44:56 -0800 (PST) Received: from [10.0.1.78] ([186.188.195.79]) by smtp.gmail.com with ESMTPSA id fa3sm13834365pab.45.2016.03.09.09.44.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Mar 2016 09:44:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: curator pathcache From: Jordan Zimmerman In-Reply-To: Date: Wed, 9 Mar 2016 12:44:47 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <8D219520-B984-48BB-9E66-C55A9D2B3175@jordanzimmerman.com> References: To: user@curator.apache.org, elastic.l.k@gmail.com X-Mailer: Apple Mail (2.3112) Moving this to Curator=E2=80=99s list=E2=80=A6 Where do you get the NPE? Please send the stacktrace. -Jordan > On Mar 8, 2016, at 8:27 PM, s influxdb wrote: >=20 > I am trying to run the path cahce and keep java NPE >=20 > Running curator 2.9.0 libraries against a zookeeper 3.4.6 cluster > Even >=20 > The samples are taken from the curator examples . >=20 >=20 >=20 > public void run () throws Exception > { > try { >=20 > pcache =3D new PathChildrenCache(client, PATH, true); > pcache.start(); >=20 > addListener(cache); >=20 > // list(pcache); >=20 > pcache.close(); > } > finally { > CloseableUtils.closeQuietly(cache); > } > } >=20 >=20 > private static void addListener(PathChildrenCache cache) > { > // a PathChildrenCacheListener is optional. Here, it's used = just > to log changes > PathChildrenCacheListener listener =3D new > PathChildrenCacheListener() > { > @Override > public void childEvent(CuratorFramework client, > PathChildrenCacheEvent event) throws Exception > { > switch ( event.getType() ) > { > case CHILD_ADDED: > { > System.out.println("Node added: " + > ZKPaths.getNodeFromPath(event.getData().getPath())); > break; > } >=20 > case CHILD_UPDATED: > { > System.out.println("Node changed: " + > ZKPaths.getNodeFromPath(event.getData().getPath())); > break; > } >=20 > case CHILD_REMOVED: > { > System.out.println("Node removed: " + > ZKPaths.getNodeFromPath(event.getData().getPath())); > break; > } > } > } > }; > cache.getListenable().addListener(listener); > } >=20 >=20 > Here running a list returns empty size all the time >=20 > private static void list(PathChildrenCache cache) > { >=20 > if ( cache.getCurrentData().size() =3D=3D 0 ) > { > System.out.println("* empty *"); > } > else > { > for ( ChildData data : cache.getCurrentData() ) > { > System.out.println(data.getPath() + " =3D " + new > String(data.getData())); > } > } > }