-
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
Deprecate class 'MasterService' and create alternative class 'ClusterManagerService' #4022
Deprecate class 'MasterService' and create alternative class 'ClusterManagerService' #4022
Conversation
Signed-off-by: Tianli Feng <[email protected]>
Signed-off-by: Tianli Feng <[email protected]>
…stead of MasterService Signed-off-by: Tianli Feng <[email protected]>
Signed-off-by: Tianli Feng <[email protected]>
Signed-off-by: Tianli Feng <[email protected]>
…e.getMasterService() Signed-off-by: Tianli Feng <[email protected]>
…viceUtils Signed-off-by: Tianli Feng <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #4022 +/- ##
============================================
- Coverage 70.65% 70.64% -0.02%
- Complexity 56904 56950 +46
============================================
Files 4579 4583 +4
Lines 273780 273931 +151
Branches 40143 40158 +15
============================================
+ Hits 193445 193511 +66
- Misses 64119 64195 +76
- Partials 16216 16225 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. |
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.
LGTM apart from the FakeThreadPoolMasterService
comment.
@@ -84,21 +84,21 @@ public void testFakeClusterManagerService() { | |||
doAnswer(invocationOnMock -> runnableTasks.add((Runnable) invocationOnMock.getArguments()[0])).when(executorService).execute(any()); | |||
when(mockThreadPool.generic()).thenReturn(executorService); | |||
|
|||
FakeThreadPoolMasterService masterService = new FakeThreadPoolMasterService( | |||
FakeThreadPoolMasterService clusterManagerService = new FakeThreadPoolMasterService( |
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.
Does the class FakeThreadPoolMasterService
need to be renamed as well?
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.
@kotwanikunal Thanks for your review. I forgot to write a note for this. 😂
I'm not going to rename this class in this PR. I plan to use the way of dealing with other classes on the 3 classes: FakeThreadPoolMasterService
BlockMasterServiceOnMaster
BusyMasterServiceDisruption
.
One PR to rename directly, and one PR to create a new class with the old name then make it a subclass of the class in new name.
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.
👍 . Hopefully you have a task to keep track of these 🙂
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.
😁 I listed the remaining items in this issue #3543 (comment), and I will check it before wrapping up the work.
…vice Signed-off-by: Tianli Feng <[email protected]> # Conflicts: # server/src/main/java/org/opensearch/cluster/service/ClusterService.java # server/src/main/java/org/opensearch/common/util/concurrent/BaseFuture.java
Gradle Check (Jenkins) Run Completed with:
|
…ManagerService' (#4022) To support inclusive language, the `master` terminology is going to be replaced by `cluster manager` in the code base. - Deprecate class `MasterService` and create alternative class `ClusterManagerService`. - Add a unit test to validate the method `ClusterService.getMasterService()` can still return an object in type `MasterService`. - Rename all the existing references of `MasterService` to `ClusterManagerService`, and rename the local variable names. - Deprecate public methods `ClusterServiceUtils.createMasterService(...)` and create alternative methods `createClusterManagerService(...)` Note: The class `ClusterManagerService` is a subclass of `MasterService`, the inheritance relationship is opposite from most of the other classes with `Master` in the name (that covered by issue #1684). The reason is: There is a public method that has return value in type `MasterService`, https://github.com/opensearch-project/OpenSearch/blob/388c80ad94529b1d9aad0a735c4740dce2932a32/server/src/main/java/org/opensearch/cluster/service/ClusterService.java#L221 And in the code for Performance Analyzer plugin, there is a local variable in type `MasterService`: https://github.com/opensearch-project/performance-analyzer/blob/5ee4809ac1cda6517ed871aeb12c6635203e7f1d/src/main/java/org/opensearch/performanceanalyzer/collectors/MasterServiceEventMetrics.java#L219 If making the old class `MasterService` a subclass of the new class `ClusterManagerService`, the above usage will be broken. Reversing the inheritance relationship, I'm able to keep the backwards compatibility of the method `getMasterService()` while deprecating the class `MasterService` and encourage using a new class `ClusterManagerService`. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 740f75d)
…ManagerService' (#4022) (#4050) To support inclusive language, the `master` terminology is going to be replaced by `cluster manager` in the code base. - Deprecate class `MasterService` and create alternative class `ClusterManagerService`. - Add a unit test to validate the method `ClusterService.getMasterService()` can still return an object in type `MasterService`. - Rename all the existing references of `MasterService` to `ClusterManagerService`, and rename the local variable names. - Deprecate public methods `ClusterServiceUtils.createMasterService(...)` and create alternative methods `createClusterManagerService(...)` Note: The class `ClusterManagerService` is a subclass of `MasterService`, the inheritance relationship is opposite from most of the other classes with `Master` in the name (that covered by issue #1684). The reason is: There is a public method that has return value in type `MasterService`, https://github.com/opensearch-project/OpenSearch/blob/388c80ad94529b1d9aad0a735c4740dce2932a32/server/src/main/java/org/opensearch/cluster/service/ClusterService.java#L221 And in the code for Performance Analyzer plugin, there is a local variable in type `MasterService`: https://github.com/opensearch-project/performance-analyzer/blob/5ee4809ac1cda6517ed871aeb12c6635203e7f1d/src/main/java/org/opensearch/performanceanalyzer/collectors/MasterServiceEventMetrics.java#L219 If making the old class `MasterService` a subclass of the new class `ClusterManagerService`, the above usage will be broken. Reversing the inheritance relationship, I'm able to keep the backwards compatibility of the method `getMasterService()` while deprecating the class `MasterService` and encourage using a new class `ClusterManagerService`. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 740f75d)
…n directory 'test/framework' (#4051) To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base. After the class MasterService has been deprecated and class ClusterManagerService has been created in #4022 / commit 740f75d, the classes in `test/framework` directory with name 'MasterService' can be deprecated and renamed. - Rename the following classes in `test/framework` directory: FakeThreadPoolMasterService -> FakeThreadPoolClusterManagerService BlockMasterServiceOnMaster -> BlockClusterManagerServiceOnClusterManager BusyMasterServiceDisruption -> BusyClusterManagerServiceDisruption In the following commit, I will add back the above 3 classes with the old name and deprecate them, to keep the backwards compatibility. Signed-off-by: Tianli Feng <[email protected]>
…n directory 'test/framework' (#4051) To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base. After the class MasterService has been deprecated and class ClusterManagerService has been created in #4022 / commit 740f75d, the classes in `test/framework` directory with name 'MasterService' can be deprecated and renamed. - Rename the following classes in `test/framework` directory: FakeThreadPoolMasterService -> FakeThreadPoolClusterManagerService BlockMasterServiceOnMaster -> BlockClusterManagerServiceOnClusterManager BusyMasterServiceDisruption -> BusyClusterManagerServiceDisruption In the following commit, I will add back the above 3 classes with the old name and deprecate them, to keep the backwards compatibility. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit bea5d1a)
…n directory 'test/framework' (#4051) (#4057) To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base. After the class MasterService has been deprecated and class ClusterManagerService has been created in #4022 / commit 740f75d, the classes in `test/framework` directory with name 'MasterService' can be deprecated and renamed. - Rename the following classes in `test/framework` directory: FakeThreadPoolMasterService -> FakeThreadPoolClusterManagerService BlockMasterServiceOnMaster -> BlockClusterManagerServiceOnClusterManager BusyMasterServiceDisruption -> BusyClusterManagerServiceDisruption In the following commit, I will add back the above 3 classes with the old name and deprecate them, to keep the backwards compatibility. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit bea5d1a) Co-authored-by: Tianli Feng <[email protected]>
Description
To support inclusive language, the
master
terminology is going to be replaced bycluster manager
in the code base.MasterService
and create alternative classClusterManagerService
.ClusterService.getMasterService()
can still return an object in typeMasterService
.MasterService
toClusterManagerService
, and rename the local variable names.ClusterServiceUtils.createMasterService(...)
and create alternative methodscreateClusterManagerService(...)
Note:
The class
ClusterManagerService
is a subclass ofMasterService
, the inheritance relationship is opposite from most of the other classes withMaster
in the name (that covered by issue #1684).The reason is:
There is a public method that has return value in type
MasterService
,OpenSearch/server/src/main/java/org/opensearch/cluster/service/ClusterService.java
Line 221 in 388c80a
And in the code for Performance Analyzer plugin, there is a local variable in type
MasterService
:https://github.com/opensearch-project/performance-analyzer/blob/5ee4809ac1cda6517ed871aeb12c6635203e7f1d/src/main/java/org/opensearch/performanceanalyzer/collectors/MasterServiceEventMetrics.java#L219
If making the old class
MasterService
a subclass of the new classClusterManagerService
, the above usage will be broken.Reversing the inheritance relationship, I'm able to keep the backwards compatibility of the method
getMasterService()
while deprecating the classMasterService
and encourage using a new classClusterManagerService
.Issues Resolved
A part of issue #3543 and #3544 (comment)
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.