-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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] Deprecate public class names with master terminology (#3871) #3914
[2.x] Deprecate public class names with master terminology (#3871) #3914
Conversation
…ect#3871) - Add back the usage of old names for some classes for backwards compatibility. Those public classes were renamed from "master" to "cluster manager" In PR opensearch-project#3619 / commit opensearch-project@a7e113a. - Add a unit test to validate the backwards compatibility of interface `LocalNodeMasterListener` remains. - Revert the renaming of class `MasterService`, `FakeThreadPoolMasterService`, `BlockMasterServiceOnMaster` and `BusyMasterServiceDisruption`, as well as instance variable names of class `MasterService`. Because I couldn't solve the compatibility problem of a public method `public ClusterManagerService getMasterService()` (opensearch-project#3871 (comment)) **List of classes that renamed in previous PR:** In this PR, the usages of the old names should all be restored. `sever` directory: interface LocalNodeMasterListener -> LocalNodeClusterManagerListener final class MasterNodeChangePredicate -> ClusterManagerNodeChangePredicate NotMasterException -> NotClusterManagerException NoMasterBlockService -> NoClusterManagerBlockService UnsafeBootstrapMasterCommand - UnsafeBootstrapClusterManagerCommand MasterNotDiscoveredException -> ClusterManagerNotDiscoveredException RestMasterAction -> RestClusterManagerAction **List of classes that not renamed:** `sever` directory: MasterService `test/framework` directory: FakeThreadPoolMasterService BlockMasterServiceOnMaster BusyMasterServiceDisruption Signed-off-by: Tianli Feng <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at |
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.
For new files, we don't need this part. This comment applies for all new files containing this licensing term.
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.
Thanks for your review! Because the file name doesn't change compared to before, so initially I didn't take them as new files. But it is reasonable to remove this part from license header.
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.
Removed those license header in commit ebb2bc9. 😄
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.
Instead of changing the backport PR for this change. Let's create a new one and change here
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.
@owaiskazi19 I will create a new PR to change the license header in main branch. Thanks for your advice!
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.
Created new PR to remove the part of license header in main branch #3924
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Tianli Feng <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Tianli Feng <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## 2.x #3914 +/- ##
============================================
- Coverage 70.64% 70.62% -0.03%
- Complexity 56398 56429 +31
============================================
Files 4520 4526 +6
Lines 271675 271706 +31
Branches 39974 39974
============================================
- Hits 191932 191890 -42
- Misses 63605 63724 +119
+ Partials 16138 16092 -46
Continue to review full report at Codecov.
|
Description
Backport PR #3871 / commit 0e96a87
LocalNodeMasterListener
remains.Note:
LocalNodeClusterManagerListener
(new name) /LocalNodeMasterListener
(old name) is used as the return value for the public methodnewHashPublisher()
. SinceLocalNodeClusterManagerListener
is the superclass ofLocalNodeMasterListener
, changing the return value to a superclass will be a breaking change, it will lead to down-casting for others who assigning the return value to a variable, so I changed the return value back to the old class nameLocalNodeMasterListener
.ExceptionSerializationTests
requires all subclass of OpenSearchException must be registered in the Exception list (code: https://github.com/opensearch-project/OpenSearch/blob/2.1.0/server/src/test/java/org/opensearch/ExceptionSerializationTests.java#L237). I modified the test to ignore the deprecated exception classesNotMasterException
andMasterNotDiscoveredException
, since there are new classesNotClusterManagerException
andClusterManagerNotDiscoveredException
as the replacement.List of classes that renamed in previous PR:
In this PR, the usages of the old names should all be restored.
sever
directory:interface LocalNodeMasterListener -> LocalNodeClusterManagerListener
final class MasterNodeChangePredicate -> ClusterManagerNodeChangePredicate
NotMasterException -> NotClusterManagerException
NoMasterBlockService -> NoClusterManagerBlockService
UnsafeBootstrapMasterCommand - UnsafeBootstrapClusterManagerCommand
MasterNotDiscoveredException -> ClusterManagerNotDiscoveredException
RestMasterAction -> RestClusterManagerAction
List of classes that was not renamed:
sever
directory:MasterService
test/framework
directory:FakeThreadPoolMasterService
BlockMasterServiceOnMaster
BusyMasterServiceDisruption
Issues Resolved
The second step to resolve issue #3543
Check List
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.