ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-146

Allow clients to retrieve the list of hosts/servers from a URL

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.6.0
    • Component/s: java client
    • Labels:
      None
    • Release Note:
      not a blocker for 3.2, moving to 3.3

      Description

      As I suggested in ZOOKEEPER-107, it would be nice to allow clients to specify their hosts strings via a URL so that this can change dynamically. For instance, obtain the current list of hosts from a webpage or a file on disk.

        Issue Links

          Activity

          Hide
          Jakob Homan added a comment -

          Un-assigning myself as it looks like some work is being done and I don't want to appear to be blocking it or such. Will keep watching to see if there is some way I can help out.

          Show
          Jakob Homan added a comment - Un-assigning myself as it looks like some work is being done and I don't want to appear to be blocking it or such. Will keep watching to see if there is some way I can help out.
          Hide
          Mahadev konar added a comment -

          this issue relates to ZOOKEEPER-237

          Show
          Mahadev konar added a comment - this issue relates to ZOOKEEPER-237
          Hide
          Jakob Homan added a comment -

          OK, I wait to see if anything happens with the C version and if so, updated with Patrick's comments at that point.

          Show
          Jakob Homan added a comment - OK, I wait to see if anything happens with the C version and if so, updated with Patrick's comments at that point.
          Hide
          Patrick Hunt added a comment -

          Agree with Mahadev, as this is an addition to the API which is b/w compatible it would be great to wait post 3.0.

          Also the javadoc for new constructors and the getHosts method should be added(ZOOKEEPER-21, just committed, adds better docs for the existing zk constructors). Review the src/docs, probably should add information to the documentation as well regarding the format of the http response, protocols supported, etc...

          Show
          Patrick Hunt added a comment - Agree with Mahadev, as this is an addition to the API which is b/w compatible it would be great to wait post 3.0. Also the javadoc for new constructors and the getHosts method should be added( ZOOKEEPER-21 , just committed, adds better docs for the existing zk constructors). Review the src/docs, probably should add information to the documentation as well regarding the format of the http response, protocols supported, etc...
          Hide
          Mahadev konar added a comment -

          this seems like a nice change.... but we dont have a similar implementation for c.... i would like to keep the c and java clients in sync as much as possible..... i would suggest moving this to post 3.0 and also provide a c counterpart to it...

          Show
          Mahadev konar added a comment - this seems like a nice change.... but we dont have a similar implementation for c.... i would like to keep the c and java clients in sync as much as possible..... i would suggest moving this to post 3.0 and also provide a c counterpart to it...
          Hide
          Jakob Homan added a comment -

          This patch:

          • Creates a new HostsProvider interface with one method (getHosts()) and two implementations of this method, StringHostsProvider and URLHostsProvider that return the list of hosts from either of those sources. The StringHostsProvider provides the same functionality that there currently is, and URL will go grab the string from http/file/etc.
          • Creates two new constructors for ZooKeeper to use URLs rather than strings.
          • Provides unit tests for the two new concrete classes.

          The patch doesn't change much of the inner workings of the ZooKeeper or ClientCnxn class, just grabs the string from the provider. It would be possible to improve disconnect behavior by checking to see if there are new hosts available before connecting.

          Show
          Jakob Homan added a comment - This patch: Creates a new HostsProvider interface with one method (getHosts()) and two implementations of this method, StringHostsProvider and URLHostsProvider that return the list of hosts from either of those sources. The StringHostsProvider provides the same functionality that there currently is, and URL will go grab the string from http/file/etc. Creates two new constructors for ZooKeeper to use URLs rather than strings. Provides unit tests for the two new concrete classes. The patch doesn't change much of the inner workings of the ZooKeeper or ClientCnxn class, just grabs the string from the provider. It would be possible to improve disconnect behavior by checking to see if there are new hosts available before connecting.

            People

            • Assignee:
              Unassigned
              Reporter:
              Jakob Homan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development