curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sznajder ForMailingList <bs4mailingl...@gmail.com>
Subject Clear a SharedCount
Date Thu, 17 Oct 2013 14:14:35 GMT
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