You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Check Peck <co...@gmail.com> on 2014/01/08 23:25:04 UTC

Update the znode data using curator?

Is there any way to update the znode data using Curator.

    CuratorFramework client = CuratorClient.createSimple("localhost:2181");
    client.start();

Suppose if the node (/my/example/hello) already exists and we just need to
update the znode data. Do I need to execute the below code again just to
update the data using curator?

    client.create().creatingParentsIfNeeded().forPath("/my/example/hello",
"new-data-inserted".getBytes());

or is there some better API for that?

Re: Update the znode data using curator?

Posted by Cameron McKenzie <mc...@gmail.com>.
CuratorFramework client = ...
client.setData().forPath("/my/example/hello",
"new-data-inserted".getBytes());


On Thu, Jan 9, 2014 at 9:25 AM, Check Peck <co...@gmail.com> wrote:

> Is there any way to update the znode data using Curator.
>
>     CuratorFramework client = CuratorClient.createSimple("localhost:2181");
>     client.start();
>
> Suppose if the node (/my/example/hello) already exists and we just need to
> update the znode data. Do I need to execute the below code again just to
> update the data using curator?
>
>     client.create().creatingParentsIfNeeded().forPath("/my/example/hello",
> "new-data-inserted".getBytes());
>
> or is there some better API for that?
>