Skip to content
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

[2.x] Rename and deprecate public methods that contains 'master' in the name in 'server' directory (#3647) #3964

Conversation

tlfeng
Copy link
Collaborator

@tlfeng tlfeng commented Jul 20, 2022

Description

Backport PR #3647 / commit 1510b94 into 2.x branch.

To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base.
This PR deprecate public and protected methods that contains master terminology in the name in server directory, except those covered by issue #3542 and #3543.

List of public methods that contain master in name that will be deprecated in this PR:

In directory - OpenSearch.server.main  (totally 27 class definitions)
public boolean hasDiscoveredMaster() {
public boolean localNodeMaster() {
public void updateMappingOnMaster(Index index, Mapping mappingUpdate, ActionListener<Void> listener) {
public boolean isBecomeMasterTask() {
public Optional<DiscoveryNode> getMasterNode() {
public PutRequest masterTimeout(TimeValue masterTimeout) {
public RemoveRequest masterTimeout(TimeValue masterTimeout) {
public static boolean isMasterNode(Settings settings) {
public boolean isMasterNode() {
public boolean isLocalNodeElectedMaster() {
public ImmutableOpenMap<String, DiscoveryNode> getMasterNodes() {
public ImmutableOpenMap<String, DiscoveryNode> getMasterAndDataNodes() {
public Stream<DiscoveryNode> mastersFirstStream() {
public String getMasterNodeId() {
public DiscoveryNode getMasterNode() {
public boolean masterNodeChanged() {
public DiscoveryNode previousMasterNode() {
public DiscoveryNode newMasterNode() {
public Builder masterNodeId(String clusterManagerNodeId) {
public boolean isLocalNodeElectedMaster() {
protected void assertClusterOrMasterStateThread() {
public void addLocalNodeMasterListener(LocalNodeMasterListener listener) {
public MasterService getMasterService() { (not changed in this PR)
public static boolean assertClusterOrMasterStateThread() {
void connectToRemoteMasterNode(TransportAddress transportAddress, ActionListener<DiscoveryNode> listener); (in interface, and not changed in this PR)
TimeValue masterNodeTimeout() (in interface, and not changed in this PR)
public synchronized void updateFromMaster(
public ClusterState joinNodesAndBecomeMaster(ClusterState clusterState, List<DiscoveryNode> nodes) {

The below test classes will not be renamed, because they are used to test the deprecated master node behavior.

public void testDoesNothingByDefaultIfMasterNodesConfigured() {
public void testDoesNotBootstrapsOnNonMasterNode() {
public void testDoesNotBootstrapsIfLocalNodeNotInInitialMasterNodes() {
public void testFailBootstrapWithBothSingleNodeDiscoveryAndInitialMasterNodes() {
public void testFailBootstrapNonMasterEligibleNodeWithSingleNodeDiscovery() {
public void testIsMasterNode() {

Other changes:

  • Changed 2 references of JoinTaskExecutor.newBecomeMasterTask() to use JoinTaskExecutor.newBecomeClusterManagerTask()

Issues Resolved

A part of issue #3544

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…e in 'server' directory (opensearch-project#3647)

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng requested review from a team and reta as code owners July 20, 2022 22:34
@tlfeng tlfeng added enhancement Enhancement or improvement to existing feature or request backport PRs or issues specific to backporting features or enhancments deprecate v2.2.0 labels Jul 20, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #3964 (eede627) into 2.x (42ee012) will decrease coverage by 0.12%.
The diff coverage is 66.32%.

@@             Coverage Diff              @@
##                2.x    #3964      +/-   ##
============================================
- Coverage     70.61%   70.48%   -0.13%     
+ Complexity    56407    56324      -83     
============================================
  Files          4526     4526              
  Lines        271706   271757      +51     
  Branches      39974    39979       +5     
============================================
- Hits         191860   191547     -313     
- Misses        63729    64072     +343     
- Partials      16117    16138      +21     
Impacted Files Coverage Δ
...n/cluster/health/TransportClusterHealthAction.java 47.75% <ø> (ø)
...settings/TransportClusterUpdateSettingsAction.java 46.55% <0.00%> (ø)
...min/cluster/state/TransportClusterStateAction.java 53.94% <0.00%> (ø)
...min/cluster/stats/TransportClusterStatsAction.java 70.83% <0.00%> (ø)
...g/opensearch/cluster/ClusterStateTaskExecutor.java 88.57% <0.00%> (-2.61%) ⬇️
...g/opensearch/cluster/ClusterStateTaskListener.java 60.00% <0.00%> (-40.00%) ⬇️
...org/opensearch/cluster/ClusterStateUpdateTask.java 100.00% <ø> (ø)
...org/opensearch/cluster/LocalClusterUpdateTask.java 92.85% <ø> (ø)
...rch/cluster/action/index/MappingUpdatedAction.java 70.49% <0.00%> (-2.39%) ⬇️
...rdination/NodeRemovalClusterStateTaskExecutor.java 96.77% <ø> (ø)
... and 523 more

@tlfeng
Copy link
Collaborator Author

tlfeng commented Jul 21, 2022

@nknize Thank you so much for your review! 👍

@tlfeng tlfeng merged commit da244c2 into opensearch-project:2.x Jul 21, 2022
@tlfeng tlfeng deleted the 2.x-deprecate-public-method-master-server branch July 21, 2022 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport PRs or issues specific to backporting features or enhancments deprecate enhancement Enhancement or improvement to existing feature or request v2.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants