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

Rename classes with name 'MasterService' to 'ClusterManagerService' in directory 'test/framework' #4051

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.test.disruption.BlockMasterServiceOnMaster;
import org.opensearch.test.disruption.BlockClusterManagerServiceOnClusterManager;
import org.opensearch.test.disruption.IntermittentLongGCDisruption;
import org.opensearch.test.disruption.NetworkDisruption;
import org.opensearch.test.disruption.NetworkDisruption.TwoPartitions;
Expand Down Expand Up @@ -316,7 +316,7 @@ public void testMappingTimeout() throws Exception {
.setTransientSettings(Settings.builder().put("indices.mapping.dynamic_timeout", "1ms"))
);

ServiceDisruptionScheme disruption = new BlockMasterServiceOnMaster(random());
ServiceDisruptionScheme disruption = new BlockClusterManagerServiceOnClusterManager(random());
setDisruptionScheme(disruption);

disruption.startDisrupting();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
import org.opensearch.test.OpenSearchIntegTestCase.Scope;
import org.opensearch.test.InternalTestCluster;
import org.opensearch.test.TestCustomMetadata;
import org.opensearch.test.disruption.BusyMasterServiceDisruption;
import org.opensearch.test.disruption.BusyClusterManagerServiceDisruption;
import org.opensearch.test.disruption.ServiceDisruptionScheme;
import org.opensearch.test.rest.FakeRestRequest;
import org.opensearch.test.transport.MockTransportService;
Expand Down Expand Up @@ -1157,7 +1157,7 @@ public void testDataNodeRestartWithBusyClusterManagerDuringSnapshot() throws Exc

final String dataNode = blockNodeWithIndex("test-repo", "test-idx");
logger.info("--> snapshot");
ServiceDisruptionScheme disruption = new BusyMasterServiceDisruption(random(), Priority.HIGH);
ServiceDisruptionScheme disruption = new BusyClusterManagerServiceDisruption(random(), Priority.HIGH);
setDisruptionScheme(disruption);
client(internalCluster().getClusterManagerName()).admin()
.cluster()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.opensearch.cluster.service.ClusterApplier;
import org.opensearch.cluster.service.ClusterApplierService;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.cluster.service.FakeThreadPoolMasterService;
import org.opensearch.cluster.service.FakeThreadPoolClusterManagerService;
import org.opensearch.cluster.service.ClusterManagerService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
Expand Down Expand Up @@ -89,7 +89,7 @@ protected PrioritizedOpenSearchThreadPoolExecutor createThreadPoolExecutor() {
}
};

final ClusterManagerService clusterManagerService = new FakeThreadPoolMasterService(
final ClusterManagerService clusterManagerService = new FakeThreadPoolClusterManagerService(
"test",
"clusterManagerService",
threadPool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.cluster.node.DiscoveryNodeRole;
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.cluster.service.FakeThreadPoolMasterService;
import org.opensearch.cluster.service.FakeThreadPoolClusterManagerService;
import org.opensearch.cluster.service.ClusterManagerService;
import org.opensearch.cluster.service.MasterServiceTests;
import org.opensearch.common.Randomness;
Expand Down Expand Up @@ -144,7 +144,7 @@ private void setupFakeClusterManagerServiceAndCoordinator(long term, ClusterStat
random()
);
final ThreadPool fakeThreadPool = deterministicTaskQueue.getThreadPool();
FakeThreadPoolMasterService fakeClusterManagerService = new FakeThreadPoolMasterService(
FakeThreadPoolClusterManagerService fakeClusterManagerService = new FakeThreadPoolClusterManagerService(
"test_node",
"test",
fakeThreadPool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
import org.opensearch.cluster.service.ClusterApplierService;
import org.opensearch.cluster.service.ClusterManagerService;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.cluster.service.FakeThreadPoolMasterService;
import org.opensearch.cluster.service.FakeThreadPoolClusterManagerService;
import org.opensearch.common.CheckedConsumer;
import org.opensearch.common.Nullable;
import org.opensearch.common.io.stream.NamedWriteableRegistry;
Expand Down Expand Up @@ -1666,7 +1666,7 @@ private final class TestClusterNode {
this.node = node;
final Environment environment = createEnvironment(node.getName());
threadPool = deterministicTaskQueue.getThreadPool(runnable -> CoordinatorTests.onNodeLog(node, runnable));
clusterManagerService = new FakeThreadPoolMasterService(
clusterManagerService = new FakeThreadPoolClusterManagerService(
node.getName(),
"test",
threadPool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.opensearch.cluster.routing.allocation.AllocationService;
import org.opensearch.cluster.service.ClusterApplierService;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.cluster.service.FakeThreadPoolMasterService;
import org.opensearch.cluster.service.FakeThreadPoolClusterManagerService;
import org.opensearch.common.Nullable;
import org.opensearch.common.Randomness;
import org.opensearch.common.UUIDs;
Expand Down Expand Up @@ -1026,7 +1026,7 @@ class ClusterNode {
private final DiscoveryNode localNode;
final MockPersistedState persistedState;
final Settings nodeSettings;
private AckedFakeThreadPoolMasterService clusterManagerService;
private AckedFakeThreadPoolClusterManagerService clusterManagerService;
private DisruptableClusterApplierService clusterApplierService;
private ClusterService clusterService;
TransportService transportService;
Expand Down Expand Up @@ -1106,7 +1106,7 @@ protected Optional<DisruptableMockTransport> getDisruptableMockTransport(Transpo
null,
emptySet()
);
clusterManagerService = new AckedFakeThreadPoolMasterService(
clusterManagerService = new AckedFakeThreadPoolClusterManagerService(
localNode.getId(),
"test",
threadPool,
Expand Down Expand Up @@ -1513,11 +1513,11 @@ int getSuccessfulAckIndex(ClusterNode clusterNode) {
}
}

static class AckedFakeThreadPoolMasterService extends FakeThreadPoolMasterService {
static class AckedFakeThreadPoolClusterManagerService extends FakeThreadPoolClusterManagerService {

AckCollector nextAckCollector = new AckCollector();

AckedFakeThreadPoolMasterService(
AckedFakeThreadPoolClusterManagerService(
String nodeName,
String serviceName,
ThreadPool threadPool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import static org.apache.lucene.tests.util.LuceneTestCase.random;
import static org.opensearch.test.OpenSearchTestCase.randomInt;

public class FakeThreadPoolMasterService extends ClusterManagerService {
private static final Logger logger = LogManager.getLogger(FakeThreadPoolMasterService.class);
public class FakeThreadPoolClusterManagerService extends ClusterManagerService {
private static final Logger logger = LogManager.getLogger(FakeThreadPoolClusterManagerService.class);

private final String name;
private final List<Runnable> pendingTasks = new ArrayList<>();
Expand All @@ -65,7 +65,7 @@ public class FakeThreadPoolMasterService extends ClusterManagerService {
private boolean taskInProgress = false;
private boolean waitForPublish = false;

public FakeThreadPoolMasterService(
public FakeThreadPoolClusterManagerService(
String nodeName,
String serviceName,
ThreadPool threadPool,
Expand Down Expand Up @@ -137,7 +137,7 @@ public void run() {
if (waitForPublish == false) {
taskInProgress = false;
}
FakeThreadPoolMasterService.this.scheduleNextTaskIfNecessary();
FakeThreadPoolClusterManagerService.this.scheduleNextTaskIfNecessary();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;

public class BlockMasterServiceOnMaster extends SingleNodeDisruption {
public class BlockClusterManagerServiceOnClusterManager extends SingleNodeDisruption {

AtomicReference<CountDownLatch> disruptionLatch = new AtomicReference<>();

public BlockMasterServiceOnMaster(Random random) {
public BlockClusterManagerServiceOnClusterManager(Random random) {
super(random);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;

public class BusyMasterServiceDisruption extends SingleNodeDisruption {
public class BusyClusterManagerServiceDisruption extends SingleNodeDisruption {
private final AtomicBoolean active = new AtomicBoolean();
private final Priority priority;

public BusyMasterServiceDisruption(Random random, Priority priority) {
public BusyClusterManagerServiceDisruption(Random random, Priority priority) {
super(random);
this.priority = priority;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class FakeThreadPoolMasterServiceTests extends OpenSearchTestCase {
public class FakeThreadPoolClusterManagerServiceTests extends OpenSearchTestCase {

public void testFakeClusterManagerService() {
List<Runnable> runnableTasks = new ArrayList<>();
Expand All @@ -84,7 +84,7 @@ public void testFakeClusterManagerService() {
doAnswer(invocationOnMock -> runnableTasks.add((Runnable) invocationOnMock.getArguments()[0])).when(executorService).execute(any());
when(mockThreadPool.generic()).thenReturn(executorService);

FakeThreadPoolMasterService clusterManagerService = new FakeThreadPoolMasterService(
FakeThreadPoolClusterManagerService clusterManagerService = new FakeThreadPoolClusterManagerService(
"test_node",
"test",
mockThreadPool,
Expand Down