Is your feature request related to a problem? Please describe.
A part of issue #1684.
To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base.
The goal for this issue is:
- Deprecate the package
org.opensearch.action.support.master, which is the only package contains "master" in the name, and it will be removed in the next major version (3.0)
- Have alternative package
org.opensearch.action.support.clustermanager as the replacement.
- Rename all public/protected classes, methods and variable contain "master" in the old package, and have alternative new class, method or variable name in the new package. Each class in the new package preserves the git history of the deprecated class as the successor.
Describe the solution you'd like
For overall solution to replace "master" in public Java APIs: #1684 (comment)
Key points:
- At the time of deprecating the package, all public/protected classes, methods or variables that contain "master" in the package will be deprecated as well, to avoid spending time modifying the same file again.
- Any public/protected Class with "master" in the name will
extend the renamed class to maintain only one class while supporting the old class.
- Any public/protected method or variable with "master" in the name will directly call the renamed method or variable, for the same reason as above.
- Renaming and deprecating class/method/variable must be in 2 separate Pull Requests, in order to be in separate git commits after PR merged.
Because there will be 2 classes as the result, one with new the name and one with the old name, and the class with new name should be the successor, only in this way can preserve the git file history in the renamed class.
In detail:
- Copy the folder of the package and keep it in another place.
- Replace
master word with clustermanager in the package name. This is done by the Rename refactoring feature of IntelliJ IDEA, so that both the definition and reference can be renamed.
- Replace
Master with ClusterManager in the class name, using the same way as above.
- replace
master with clusterManager in the method name, using the same way as above.
- Create a Pull Request for the above changes, so that the file renaming can be tracked in the git history.
- Wait until the PR merged.
- Paste the original
master folder back.
- Add
@Deprecated annotation and @deprecated Javadoc tag in package-info.java to mark the whole package as deprecated.
- Remove all the existing implementation in the old classes, except any public/protected method or variable that contains "master" name. Make the old class extends the new renamed class.
For class, adding all the constructors of the super class.
For the method or variable contains inclusive name, change its implementation to call the corresponding ones in super class.
- Add
@Deprecated annotation and @deprecated Javadoc tag for the class and method that contains "master" in the name.
- If the renamed class has unit test, copy the unit test to test the deprecated class.
- Backport all the changes to 2.x branch.
Example of the 2 commits:
In branch: https://github.com/tlfeng/OpenSearch/commits/rename-master-package-preview
First step: rename - tlfeng@cdc3de4
Second step: add old usage back and deprecate: tlfeng@e484e0f
Describe alternatives you've considered
None.
Additional context
The package org.opensearch.action.support.master has got 15 Java classes inside.
6 classes of those having "master" in the names.
8 methods and 2 variables in these classes having "master" in the names.
1 Class to be renamed:
MasterNodeOperationRequestBuilder
MasterNodeReadOperationRequestBuilder
MasterNodeReadRequest
MasterNodeRequest
TransportMasterNodeAction
TransportMasterNodeReadAction
2 Method and variable to be renamed:
In class MasterNodeRequest -
TimeValue DEFAULT_MASTER_NODE_TIMEOUT
TimeValue masterNodeTimeout
Request masterNodeTimeout(TimeValue timeout)
Request masterNodeTimeout(String timeout)
TimeValue masterNodeTimeout()
In class TransportMasterNodeAction -
void masterOperation(Request request, ClusterState state, ActionListener listener)
void masterOperation(Task task, Request request, ClusterState state, ActionListener listener)
String getMasterActionName(DiscoveryNode node)
In class TransportClusterInfoAction -
void masterOperation(final Request request, final ClusterState state, final ActionListener listener)
void doMasterOperation(Request request, String[] concreteIndices, ClusterState state, ActionListener listener)
Is your feature request related to a problem? Please describe.
A part of issue #1684.
To support inclusive language, the
masterterminology is going to be replaced bycluster managerin the code base.The goal for this issue is:
org.opensearch.action.support.master, which is the only package contains "master" in the name, and it will be removed in the next major version (3.0)org.opensearch.action.support.clustermanageras the replacement.Describe the solution you'd like
For overall solution to replace "master" in public Java APIs: #1684 (comment)
Key points:
extendthe renamed class to maintain only one class while supporting the old class.Because there will be 2 classes as the result, one with new the name and one with the old name, and the class with new name should be the successor, only in this way can preserve the git file history in the renamed class.
In detail:
masterword withclustermanagerin the package name. This is done by the Rename refactoring feature of IntelliJ IDEA, so that both the definition and reference can be renamed.MasterwithClusterManagerin the class name, using the same way as above.masterwithclusterManagerin the method name, using the same way as above.masterfolder back.@Deprecatedannotation and@deprecatedJavadoc tag inpackage-info.javato mark the whole package as deprecated.For class, adding all the constructors of the super class.
For the method or variable contains inclusive name, change its implementation to call the corresponding ones in super class.
@Deprecatedannotation and@deprecatedJavadoc tag for the class and method that contains "master" in the name.Example of the 2 commits:
In branch: https://github.com/tlfeng/OpenSearch/commits/rename-master-package-preview
First step: rename - tlfeng@cdc3de4
Second step: add old usage back and deprecate: tlfeng@e484e0f
Describe alternatives you've considered
None.
Additional context
The package
org.opensearch.action.support.masterhas got 15 Java classes inside.6 classes of those having "master" in the names.
8 methods and 2 variables in these classes having "master" in the names.
1 Class to be renamed:
MasterNodeOperationRequestBuilder
MasterNodeReadOperationRequestBuilder
MasterNodeReadRequest
MasterNodeRequest
TransportMasterNodeAction
TransportMasterNodeReadAction
2 Method and variable to be renamed:
In class MasterNodeRequest -
TimeValue DEFAULT_MASTER_NODE_TIMEOUT
TimeValue masterNodeTimeout
Request masterNodeTimeout(TimeValue timeout)
Request masterNodeTimeout(String timeout)
TimeValue masterNodeTimeout()
In class TransportMasterNodeAction -
void masterOperation(Request request, ClusterState state, ActionListener listener)
void masterOperation(Task task, Request request, ClusterState state, ActionListener listener)
String getMasterActionName(DiscoveryNode node)
In class TransportClusterInfoAction -
void masterOperation(final Request request, final ClusterState state, final ActionListener listener)
void doMasterOperation(Request request, String[] concreteIndices, ClusterState state, ActionListener listener)