Open tlfeng opened 2 years ago
Result:
On 2.x
branch:
@Deprecated
annotation
b. @deprecated
tag in Javadoc, @deprecated As of 2.1, because supporting inclusive language, replaced by {@link <new_class>#<new_method>}
On main
branch:
Implementation:
On main
branch, and for each public and protected class/method/variable which contains "master" terminology,
@Deprecated
annotation and @deprecated
tag in Javadocextends
the new renamed class.
For package, apply the class change to all classes in the package.
For method, call the new renamed method in the old method.2.x
branch.Note:
Appendix
The regex to filter the lines of code with public Java API contains "master" terminology:
class: (public|protected)(.)+(class|interface)\s(\w)*Master
method: (public|protected)(.)+[Mm]aster(\w)*\(
variable: (public|protected)(.)+(MASTER|master)(.)*=
Renaming rule:
Is your feature request related to a problem? Please describe. Replace the "master" terminology in all Java APIs, including field, method, class, and package names. The "Java APIs" refers to those packaged in Java libraries and are published to Maven (https://search.maven.org/search?q=g:org.opensearch https://mvnrepository.com/artifact/org.opensearch)
Impact: All plugins, clients and tools that use OpenSearch Java APIs from OpenSearch Java libraries which contain non-inclusive terminologies have to make corresponding changes to call new APIs, if they want to upgrade the dependency to a future major version of OpenSearch.
A part of #472
Describe the solution you'd like Replace the "master" terminology with "ClusterManager" in all Java APIs that are exposed in Java libraries.
Overall solution: https://github.com/opensearch-project/OpenSearch/issues/1684#issuecomment-1145541374 Sub-issue:
Describe alternatives you've considered None.
Additional context Locations of "master" in API of Java library: These libraries have been published to Maven. (Links: https://mvnrepository.com/artifact/org.opensearch https://search.maven.org/search?q=g:org.opensearch)
server 1 package
org.opensearch.action.support.master
https://opensearch.org/javadocs/1.1.0/OpenSearch/server/build/docs/javadoc/org/opensearch/action/support/master/package-summary.html (totally 1 package, the package contains 15 Java classes) 2 classorg.opensearch.cluster.MasterNodeChangePredicate
https://opensearch.org/javadocs/2.0.0/OpenSearch/server/build/docs/javadoc/org/opensearch/cluster/MasterNodeChangePredicate.html (totally 14 classes) 3 variableorg.opensearch.action.support.master.MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT
https://opensearch.org/javadocs/1.1.0/OpenSearch/server/build/docs/javadoc/org/opensearch/action/support/master/MasterNodeRequest.html#DEFAULT_MASTER_NODE_TIMEOUT (totally 15 variables) 4 methodorg.opensearch.cluster.node.DiscoveryNodes.Builder.masterNodeId(String)
https://opensearch.org/javadocs/2.0.0/OpenSearch/server/build/docs/javadoc/org/opensearch/cluster/node/DiscoveryNodes.Builder.html#masterNodeId(java.lang.String) ... (In version 1.1.0, totally 177 methods) (In version 2.0.0, totally 142 methods)Java Low Level REST Client 1 variable
org.opensearch.client.NodeSelector.SKIP_DEDICATED_MASTERS
https://opensearch.org/javadocs/1.1.0/OpenSearch/client/rest/build/docs/javadoc/org/opensearch/client/NodeSelector.html#SKIP_DEDICATED_MASTERS (totally 1 variable) 2 methodorg.opensearch.client.Node.Roles.isMasterEligible()
https://opensearch.org/javadocs/1.1.0/OpenSearch/client/rest/build/docs/javadoc/org/opensearch/client/Node.Roles.html#isMasterEligible() (totally 1 method)Java High Level REST Client 1 variable
org.opensearch.client.TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT
https://opensearch.org/javadocs/1.1.0/OpenSearch/client/rest-high-level/build/docs/javadoc/org/opensearch/client/TimedRequest.html#DEFAULT_MASTER_NODE_TIMEOUT (totally 1 variable) 2 methodorg.opensearch.client.TimedRequest.masterNodeTimeout()
https://opensearch.org/javadocs/2.0.0/OpenSearch/client/rest-high-level/build/docs/javadoc/org/opensearch/client/TimedRequest.html#masterNodeTimeout() (totally 11 methods)Test Framework 1 class
org.opensearch.test.disruption.BlockMasterServiceOnMaster
https://opensearch.org/javadocs/2.0.0/OpenSearch/test/framework/build/docs/javadoc/org/opensearch/test/disruption/BlockMasterServiceOnMaster.html (totally 3 classes) 2 variableorg.opensearch.test.InternalTestCluster.DEFAULT_HIGH_NUM_MASTER_NODES
https://opensearch.org/javadocs/2.0.0/OpenSearch/test/framework/build/docs/javadoc/org/opensearch/test/InternalTestCluster.html#DEFAULT_HIGH_NUM_MASTER_NODES (totally 4 variables) 3 methodorg.opensearch.client.Client.masterClient()
https://opensearch.org/javadocs/2.0.0/OpenSearch/test/framework/build/docs/javadoc/org/opensearch/test/InternalTestCluster.html#masterClient() (totally 41 methods)