开发者

In ZooKeeper, Could I use async getData() on a non-exist znode?

Even I called exists() method, I should check Code.NoNode too.

Thus could I use getData() method directly?

I notice the sync getData() will throw exception if node does not exist. Thus will I got any penalty on performance or other aspect if I called an async getData on a n开发者_如何学Goon-exist znode?

Thank you!


If you want to get the content of the znode you should use getData instead of using exists and then getData.

Because anyway you should check for Code.NoNode after getting response from getData. So why don't call it directly?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜