Skip to content

Commit

Permalink
Changed master nomenclature to cluster_manager(2) (opensearch-project…
Browse files Browse the repository at this point in the history
…#175)

Signed-off-by: Dhrubajyoti Das <[email protected]>

Signed-off-by: Dhrubajyoti Das <[email protected]>
Co-authored-by: Dhrubajyoti Das <[email protected]>
Signed-off-by: Arpit Bandejiya <[email protected]>
  • Loading branch information
2 people authored and Arpit-Bandejiya committed Nov 2, 2022
1 parent 4f1f992 commit 7a0fc05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ private void performPersistedResponseCleanUpAction(AsynchronousSearchCleanUpRequ

@Override
public void clusterChanged(ClusterChangedEvent event) {
if (event.localNodeMaster() && persistedResponseCleanUpRunnable.get() == null) {
if (event.localNodeClusterManager() && persistedResponseCleanUpRunnable.get() == null) {
logger.trace("elected as cluster_manager, triggering response cleanup tasks");
triggerCleanUp(event.state(), "became cluster_manager");

final PersistedResponseCleanUpAndRescheduleRunnable newRunnable = new PersistedResponseCleanUpAndRescheduleRunnable();
persistedResponseCleanUpRunnable.set(newRunnable);
threadPool.scheduleUnlessShuttingDown(persistedResponseCleanUpInterval, RESPONSE_CLEANUP_SCHEDULING_EXECUTOR, newRunnable);
} else if (event.localNodeMaster() == false) {
} else if (event.localNodeClusterManager() == false) {
persistedResponseCleanUpRunnable.set(null);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ private static DiscoveryNodes createDiscoveryNodes(final int numNodes, final boo
if (i == 0) {
//local node id
builder.localNodeId(nodeId);
roles.add(DiscoveryNodeRole.MASTER_ROLE);
roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE);
} else if (i == 1) {
// the alternate cluster_manager node
roles.add(DiscoveryNodeRole.MASTER_ROLE);
roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE);
} else if (i == 2) {
// we need at least one data node
roles.add(DiscoveryNodeRole.DATA_ROLE);
} else {
// remaining nodes can be anything (except for cluster_manager)
if (randomBoolean()) {
roles.add(DiscoveryNodeRole.MASTER_ROLE);
roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE);
}
if (randomBoolean()) {
roles.add(DiscoveryNodeRole.DATA_ROLE);
Expand All @@ -238,7 +238,7 @@ private static DiscoveryNodes createDiscoveryNodes(final int numNodes, final boo
final DiscoveryNode node = newNode(nodeId, roles);
builder.add(node);
if (i == clusterManagerNodeIndex) {
builder.masterNodeId(nodeId);
builder.clusterManagerNodeId(nodeId);
}
}
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public static ClusterService createClusterService(Settings settings, ThreadPool
.nodes(DiscoveryNodes.builder()
.add(localNode)
.localNodeId(localNode.getId())
.masterNodeId(localNode.getId()))
.clusterManagerNodeId(localNode.getId()))
.blocks(ClusterBlocks.EMPTY_CLUSTER_BLOCK).build();
clusterService.getClusterApplierService().setInitialState(initialClusterState);
clusterService.getMasterService().setClusterStatePublisher(
clusterService.getClusterManagerService().setClusterStatePublisher(
createClusterStatePublisher(clusterService.getClusterApplierService()));
clusterService.getMasterService().setClusterStateSupplier(clusterService.getClusterApplierService()::state);
clusterService.getClusterManagerService().setClusterStateSupplier(clusterService.getClusterApplierService()::state);
clusterService.start();
return clusterService;
}
Expand Down

0 comments on commit 7a0fc05

Please sign in to comment.