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

[Backport 2.x] Deprecate class 'MasterService' and create alternative class 'ClusterManagerService' #4050

Merged
merged 1 commit into from
Jul 30, 2022

Commits on Jul 30, 2022

  1. Deprecate class 'MasterService' and create alternative class 'Cluster…

    …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:/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:/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)
    Tianli Feng authored and github-actions[bot] committed Jul 30, 2022
    Configuration menu
    Copy the full SHA
    0566b79 View commit details
    Browse the repository at this point in the history