jurmous / etcd4j

Java / Netty client for etcd, the highly-available key value store for shared configuration and service discovery.
Apache License 2.0
267 stars 83 forks source link

mousio.etcd4j.EtcdClient.getDir(String) has no effect #180

Open bestcode opened 5 years ago

bestcode commented 5 years ago

It seems that the function getDir(String) returns the same result as get(String). There's no difference between them. It sounds like the getDir should return "dir" nodes only, but in fact it returns all kinds of nodes. What's the purpose that the getDir() born for ?

lburgazzoli commented 5 years ago

getDir adds an additional attribute to the request, see:

bestcode commented 5 years ago

thanks for your quick response @lburgazzoli . but I found this attribute has no effect when adding to a GET request, as I tested against my etcd deployment. I mean these two requests have the same result: curl 'http://ip:port/v2/keys/somedir' curl 'http://ip:port/v2/keys/somedir?dir=true'

so what's the meaning to add this attribute to a GET request? I'm a new hand to etcd, so if my question is not proper, forgive me.

lburgazzoli commented 5 years ago

it was supposed to work, which etcd version?

On Wed, 19 Sep 2018 at 13:08, neilcheng notifications@github.com wrote:

thanks for your quick response @lburgazzoli https://github.com/lburgazzoli . but I found this attribute has no effect when adding to a GET request, as I tested against my etcd deployment. I mean these two requests have the same result: curl 'http://ip:port/v2/keys/somedir' curl 'http://ip:port/v2/keys/somedir?dir=true'

so what's the meaning to add this attribute to a GET request? I'm a new hand to etcd, so if my question is not proper, forgive me.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jurmous/etcd4j/issues/180#issuecomment-422759989, or mute the thread https://github.com/notifications/unsubscribe-auth/AByEhWx0MXEUepTbjyeHu9YLXVITnTIYks5uciW3gaJpZM4Wv5p1 .

--

Luca Burgazzoli