Skip to content

Commit

Permalink
Deprecate class FakeThreadPoolMasterService, BlockMasterServiceOnMast…
Browse files Browse the repository at this point in the history
…er and BusyMasterServiceDisruption (#4058)

To support inclusive language, the master terminology is going to be replaced by cluster manager in the code base.

In a previous PR #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 <ftianli@amazon.com>
  • Loading branch information
Tianli Feng authored Aug 1, 2022
1 parent bea5d1a commit cebeb8c
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 cebeb8c

Please sign in to comment.