开发者

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

开发者 https://www.devze.com 2023-03-10 21:17 出处:网络
Even I called exists() method, I should check Code.NoNode too. Thus could I use getData() method directly?

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

精彩评论

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

关注公众号