curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: Clear a SharedCount
Date Thu, 17 Oct 2013 14:46:22 GMT
SharedCount uses the path that you pass to it. So, you can delete that node.

-JZ

On Oct 17, 2013, at 7:14 AM, Sznajder ForMailingList <bs4mailinglist@gmail.com> wrote:

> Hi,
> 
> I am interested to remove all the sharedCount I am currently handling.
> I thought about this piece of code
> 
>     public void clear() throws Exception {
>         for (String key : getKeys()) {
>             SharedCount count = getSharedCount(key);
>             count.close();
>             if (this.framework.checkExists().forPath(this.path + "/" + key) != null)
{
>                 this.framework.delete().guaranteed().forPath(this.path + "/" + key);
>             }
>         }
>     }
> 
> 
> When getKeys() returns  the path to the current SharedCound I am handling.
> 
> However, when I try to read the content of the node after this call, I still get a getCount()
superior to 0 (I mean the znode and its shared value still exist...)
> 
> 
> Benjamin


Mime
View raw message