etcd4j icon indicating copy to clipboard operation
etcd4j copied to clipboard

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

Open bestcode opened this issue 6 years ago • 3 comments

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 ?

bestcode avatar Sep 19 '18 10:09 bestcode

getDir adds an additional attribute to the request, see:

  • https://github.com/jurmous/etcd4j/blob/master/src/main/java/mousio/etcd4j/EtcdClient.java#L286
  • https://github.com/jurmous/etcd4j/blob/master/src/main/java/mousio/etcd4j/requests/EtcdKeyGetRequest.java#L90

lburgazzoli avatar Sep 19 '18 10:09 lburgazzoli

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.

bestcode avatar Sep 19 '18 11:09 bestcode

it was supposed to work, which etcd version?

On Wed, 19 Sep 2018 at 13:08, neilcheng [email protected] 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

lburgazzoli avatar Sep 19 '18 11:09 lburgazzoli