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 16:45:12 GMT
SharedCount has a seed value - so that is returned even if there isn't a node.

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

> Hi
> 
> Thanks for your answer. But I was carefull to close the sharedcount before trying to
remove it....
> 
> Benjamin
> 
> 
> On Thu, Oct 17, 2013 at 5:46 PM, Jordan Zimmerman <jordan@jordanzimmerman.com>
wrote:
> 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