-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Reconfiguration #273
Dynamic Reconfiguration #273
Conversation
Great! Thank you for this PR @bhack-onshape ! I will have a look at it during this week. |
LGTM. The only thing that I have spotted missing are TypeScript definitions. @bhack-onshape do you think you would be able to add TypeScript definitions for the new methods? There is also |
The The TypeScript definition file is generated using a script/cli, based on the If there is a need for new data types, please add them to |
There's no new data types but the config_version is a Number rather than int32 since it's a 64 bit. And therefore theoretically may not be representable.JSdoc comments for the new functions should be good already unless I missed something. |
Okay, all is clear to me now! |
Sorry for the delay @bhack-onshape! I shouldn't have promised to merge this before last week, and I apologize for that. Your PR is much appreciated and I will merge this as soon as possible, but have been under heavy work load lately 😄 Things look much better now and I will try to schedule a review, merge and release package. |
That's alright @DavidVujic ! I know what a heavy work load is like :) Is not a massively urgent thing for me to get this merged and released as the npm install process for my app clones my forked repo, builds, and uses that directly rather than using this repo at the moment. So I'm not blocked on anything. |
@@ -694,6 +753,11 @@ class ZooKeeper extends EventEmitter { | |||
return NativeZk.ZOOKEEPER_READ; | |||
} | |||
|
|||
/** @deprecated @returns {string} "/zookeeper/config" */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should have been added to the constants.js
file instead, do direct users there instead. Long term, I would like to remove all code marked as deprecated in the source code,.
I will add it in a separate PR.
Exposes the dynamic reconfiguration methods from the core ZooKeeper API to the top level JavaScript ZooKeeper class.
Description
Exposes the following methods to the ZooKeeper class as both async and callback funtions:
zoo_agetconfig
zoo_awgetconfig
zoo_areconfig
The following only has one variant as it's a syncronous function
zoo_setservers
Also expose the
ZOO_CONFIG_NODE
constantThese allow the user to implement client side dynamic reconfiguration support.
Motivation and Context
Adds Dynamic Reconfiguration support to the client
#208
How Has This Been Tested?
Tested in an external command line ZooKeeper client application that uses this module and implements a full client Dynamic Reconfiguration workflow. Also tested unauthenticated reconfiguration from the same client app.
Implementation is a straight line from the C API to top level JavaScript functions with no interaction with other parts of the codebase.
Types of changes
Checklist: