Skip to content

Commit

Permalink
Deprecate class FakeThreadPoolMasterService, BlockMasterServiceOnMast…
Browse files Browse the repository at this point in the history
…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
Tianli Feng authored and pranikum committed Aug 2, 2022
1 parent b3721e0 commit 5200f32
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
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);
}
}
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);
}
}
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);
}
}

0 comments on commit 5200f32

Please sign in to comment.