-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
[ZOOKEEPER-2642] Resurrect the reconfig() methods that were in ZooKeeper.java. #122
Conversation
….5.x is an alpha there are clients in production that are relying on the current specification. The reconfig() methods are marked deprecated to inform that they will be removed later. The "new" methods in the new class ZooKeeperAdmin were renamed reconfigure() to avoid getting the deprecation annotation inherited and to provide clarity. Both reconfig() and reconfigure() are implemented via protected methods in ZooKeeper.java
Please also update the reconfig documentation about deprecating old API and about the new API in ZooKeeperAdmin: Other than this, the patch lgtm. |
import org.apache.zookeeper.proto.SetDataResponse; | ||
import org.apache.zookeeper.proto.SyncRequest; | ||
import org.apache.zookeeper.proto.SyncResponse; | ||
import org.apache.zookeeper.proto.*; |
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.
If I remember well, Patrick Hunt once told me during a code review that we should use explicit imports instead of wildcards. Right, @phunt ?
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.
fixed
@@ -2910,4 +2923,49 @@ private ClientCnxnSocket getClientCnxnSocket() throws IOException { | |||
throw ioe; | |||
} | |||
} | |||
|
|||
protected byte[] internalReconfig(String joiningServers, String leavingServers, String newMembers, long fromConfig, Stat stat) throws KeeperException, InterruptedException | |||
{ |
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.
nit: inconsistent brace style for method names from line onwards.
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.
fixed
|
||
<para>Note: for temporary backward compatibility, the reconfig() APIs will remain in ZooKeeper.java | ||
where they were for a few alpha versions of 3.5.x. However, these APIs are deprecated and users | ||
should move to the reconfig() APIs in ZooKeeperAdmin.java. |
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.
Small typo: reconfig()
should be reconfigure()
.
Just so that I understand, when are we going to be removing these deprecated methods, in trunk? I'm asking this for two reasons:
|
Maybe when we get a stable release of 3.5?
Agree, for trunk the change would be just rename ZooKeeperAdmin::reconfig to ZooKeeperAdmin::reconfigure so it's consistent with branch-3.5 (with some documentation updates and tests update.). |
I think this patch is ready to land... @fpj What do you think? |
Are you OK with us removing the deprecated methods when 3.5 becomes GA?
We need to either create a new issue or have a different pull request for 3.5 under this same issue. I'd rather do the latter just so that we wrap this up in one shot, but it depends on whether @Randgalt is willing to do it. |
No. I'd vote against that. Breaking changes should be in a 3.6 version. That was the genesis of this issue to begin with. Regardless of the intent of the ZK team, 3.5.x has been in production in a large number of companies for years now. To break a public API without increment the version will cause unnecessary problems. |
FYI - my PR/patch does rename to |
Sounds OK to me.
I think this pull request (122) should target branch 3.5, because it keeps the old API. We need create a new PR that target master which only contain updates to the API name (reconfig -> reconfigure) and some doc / test updates without bringing back the old APIs. @Randgalt Could you update the base branch of this PR to be branch-3.5 instead of master? I think this PR is ready to land in branch-3.5. @fpj I can create a new PR target master that only contain API name changes, if @Randgalt does not get ahead of me on this work. |
Will do |
See #151 |
Do we need a separate issue for the 3.6 change? |
No we don't (what @fpj prefers wrapping both PR in one shot under ZOOKEEPER-2642). @Randgalt Do you mind update the current PR (#122) so it apply to master, by removing the old reconfig APIs? |
OK - to be clear, I have PR #151 which applies the legacy API to branch-3.5. Then, I'll rework this PR (against master) to only have the Admin API, right? |
@Randgalt Exactly. Thanks! |
Was #122 Author: randgalt <[email protected]> Reviewers: Michael Han <[email protected]> Closes #152 from Randgalt/ZOOKEEPER-2642
Was apache#122 Author: randgalt <[email protected]> Reviewers: Michael Han <[email protected]> Closes apache#152 from Randgalt/ZOOKEEPER-2642
Was apache#122 Author: randgalt <[email protected]> Reviewers: Michael Han <[email protected]> Closes apache#152 from Randgalt/ZOOKEEPER-2642
Resurrect the reconfig() methods that were in ZooKeeper.java. While 3.5.x is an alpha there are clients in production that are relying on the current specification. The reconfig() methods are marked deprecated to inform that they will be removed later. The "new" methods in the new class ZooKeeperAdmin were renamed reconfigure() to avoid getting the deprecation annotation inherited and to provide clarity. Both reconfig() and reconfigure() are implemented via protected methods in ZooKeeper.java