-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…3914) * Deprecate public class names with master terminology (#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 #3619 / commit 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()` (#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]>
- Loading branch information
Tianli Feng
authored
Jul 15, 2022
1 parent
21c45a5
commit 298cc9c
Showing
11 changed files
with
248 additions
and
4 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.cluster; | ||
|
||
/** | ||
* Enables listening to cluster-manager changes events of the local node (when the local node becomes the cluster-manager, and when the local | ||
* node cease being a cluster-manager). | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link LocalNodeClusterManagerListener} | ||
*/ | ||
@Deprecated | ||
public interface LocalNodeMasterListener extends LocalNodeClusterManagerListener { | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.cluster; | ||
|
||
import java.util.function.Predicate; | ||
|
||
/** | ||
* Utility class to build a predicate that accepts cluster state changes | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link ClusterManagerNodeChangePredicate} | ||
*/ | ||
@Deprecated | ||
public final class MasterNodeChangePredicate { | ||
|
||
private MasterNodeChangePredicate() { | ||
|
||
} | ||
|
||
public static Predicate<ClusterState> build(ClusterState currentState) { | ||
return ClusterManagerNodeChangePredicate.build(currentState); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
server/src/main/java/org/opensearch/cluster/NotMasterException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.cluster; | ||
|
||
import org.opensearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Thrown when a node join request or a cluster-manager ping reaches a node which is not | ||
* currently acting as a cluster-manager or when a cluster state update task is to be executed | ||
* on a node that is no longer cluster-manager. | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link NotClusterManagerException} | ||
*/ | ||
@Deprecated | ||
public class NotMasterException extends NotClusterManagerException { | ||
|
||
public NotMasterException(String msg) { | ||
super(msg); | ||
} | ||
|
||
public NotMasterException(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.cluster.coordination; | ||
|
||
import org.opensearch.common.settings.ClusterSettings; | ||
import org.opensearch.common.settings.Settings; | ||
|
||
/** | ||
* Service to block the master node | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link NoClusterManagerBlockService} | ||
*/ | ||
@Deprecated | ||
public class NoMasterBlockService extends NoClusterManagerBlockService { | ||
|
||
public NoMasterBlockService(Settings settings, ClusterSettings clusterSettings) { | ||
super(settings, clusterSettings); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.cluster.coordination; | ||
|
||
/** | ||
* Tool to run an unsafe bootstrap | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link UnsafeBootstrapClusterManagerCommand} | ||
*/ | ||
@Deprecated | ||
public class UnsafeBootstrapMasterCommand extends UnsafeBootstrapClusterManagerCommand { | ||
|
||
UnsafeBootstrapMasterCommand() { | ||
super(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
server/src/main/java/org/opensearch/discovery/MasterNotDiscoveredException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.discovery; | ||
|
||
import org.opensearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Exception when the cluster-manager is not discovered | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link ClusterManagerNotDiscoveredException} | ||
*/ | ||
@Deprecated | ||
public class MasterNotDiscoveredException extends ClusterManagerNotDiscoveredException { | ||
|
||
public MasterNotDiscoveredException() { | ||
super(); | ||
} | ||
|
||
public MasterNotDiscoveredException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public MasterNotDiscoveredException(String message) { | ||
super(message); | ||
} | ||
|
||
public MasterNotDiscoveredException(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.rest.action.cat; | ||
|
||
/** | ||
* _cat API action to list cluster_manager information | ||
* | ||
* @opensearch.api | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link RestClusterManagerAction} | ||
*/ | ||
@Deprecated | ||
public class RestMasterAction extends RestClusterManagerAction { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters