forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate class FakeThreadPoolMasterService, BlockMasterServiceOnMast…
…er and BusyMasterServiceDisruption (opensearch-project#4058) To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base. In a previous PR opensearch-project#4051, 3 classes in `test/framework` directory that contains `master` in the name were renamed: ``` FakeThreadPoolMasterService -> FakeThreadPoolClusterManagerService BlockMasterServiceOnMaster -> BlockClusterManagerServiceOnClusterManager BusyMasterServiceDisruption -> BusyClusterManagerServiceDisruption ``` This is a following commit to add back the classes with the old name to keep the backwards compatibility. The classes with the old name will be subclass of the classes with new name, so that maintaining one implementation can support the usage for two classes. Signed-off-by: Tianli Feng <[email protected]>
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.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,28 @@ | ||
/* | ||
* 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.service; | ||
|
||
import org.opensearch.threadpool.ThreadPool; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link FakeThreadPoolClusterManagerService} | ||
*/ | ||
@Deprecated | ||
public class FakeThreadPoolMasterService extends FakeThreadPoolClusterManagerService { | ||
public FakeThreadPoolMasterService( | ||
String nodeName, | ||
String serviceName, | ||
ThreadPool threadPool, | ||
Consumer<Runnable> onTaskAvailableToRun | ||
) { | ||
super(nodeName, serviceName, threadPool, onTaskAvailableToRun); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.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.test.disruption; | ||
|
||
import java.util.Random; | ||
|
||
/** | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link BlockClusterManagerServiceOnClusterManager} | ||
*/ | ||
@Deprecated | ||
public class BlockMasterServiceOnMaster extends BlockClusterManagerServiceOnClusterManager { | ||
public BlockMasterServiceOnMaster(Random random) { | ||
super(random); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.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,23 @@ | ||
/* | ||
* 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.test.disruption; | ||
|
||
import org.opensearch.common.Priority; | ||
|
||
import java.util.Random; | ||
|
||
/** | ||
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link BusyClusterManagerServiceDisruption} | ||
*/ | ||
@Deprecated | ||
public class BusyMasterServiceDisruption extends BusyClusterManagerServiceDisruption { | ||
public BusyMasterServiceDisruption(Random random, Priority priority) { | ||
super(random, priority); | ||
} | ||
} |