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

Replace non-inclusive terminology 'master' in code comments and internal variable/method/class names #2150

Closed
wants to merge 28 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
45ee23d
Replace master in NoMasterBlockService class
Feb 15, 2022
b597d96
Replace master in Coordinator class
Feb 15, 2022
e71406e
Replace master in ClusterHealthResponse class
Feb 15, 2022
541ce80
Replace master in Method withMasterTimeout()
Feb 15, 2022
7679794
Replace master in TimedRequest class
Feb 15, 2022
c80b14f
Replace master in Method get/setMasterTimeout()
Feb 15, 2022
f1a63ef
Replace master of method SetRandomMasterTimeout()
Feb 15, 2022
998e88d
Replace master in subprojects - client modules plugins qa
Feb 15, 2022
50f0de0
Replace master in TestCluster classes
Feb 16, 2022
cbc71a2
Replace master in test.framework test classes
Feb 16, 2022
9835546
Replace master terminology in classes of server directories
Feb 17, 2022
9b4719b
adjust format by spotlessApply
tlfeng Feb 17, 2022
b41fe3b
Replace master terminology in classes of server directories - leftover
tlfeng Feb 17, 2022
e2e9347
Replace master in server classes - leftover
Feb 17, 2022
1e42576
Adjust format by spotlessApply task
Feb 17, 2022
9026aed
Replace master in server test classes
Feb 17, 2022
63282ff
Merge remote-tracking branch 'upstream/main' into replace-master-inte…
Feb 17, 2022
8af6374
Adjust format by spotlessApply task
Feb 17, 2022
ce8c7e9
Adjust format by spotlessApply task
Feb 17, 2022
7e352ef
Change 'clustermanager' to 'cluster_manager' or 'cluster manager' in …
Feb 18, 2022
9d3b42f
Merge branch 'main' into replace-master-internal
Mar 7, 2022
d8b016d
Merge branch 'main' into replace-master-internal
tlfeng Mar 8, 2022
91d768c
Rename initialMasterNodes
Mar 16, 2022
4f1211c
Merge remote-tracking branch 'origin/main' into replace-master-internal
Mar 16, 2022
717bc11
Rename clusterManagerNodeNames
Mar 16, 2022
36a5bbe
Merge branch 'main' into replace-master-internal
Mar 17, 2022
0817155
Merge branch 'main' into replace-master-internal
Mar 19, 2022
3c204eb
Restore rename DISCOVERED_MASTER in ClusterHealthResponse
Mar 19, 2022
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
Prev Previous commit
Next Next commit
Replace master in subprojects - client modules plugins qa
Signed-off-by: Tianli Feng <[email protected]>
Tianli Feng committed Feb 15, 2022
commit 998e88d27f4fd98178db51404a4413ad69431b6b
Original file line number Diff line number Diff line change
@@ -210,7 +210,7 @@ public Roles(final Set<String> roles) {
}

/**
* Teturns whether or not the node <strong>could</strong> be elected master.
* Teturns whether or not the node <strong>could</strong> be elected clustermanager.
*/
public boolean isMasterEligible() {
return roles.contains("master");
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@

/**
* Selects nodes that can receive requests. Used to keep requests away
* from master nodes or to send them to nodes with a particular attribute.
* from clustermanager nodes or to send them to nodes with a particular attribute.
* Use with {@link RestClientBuilder#setNodeSelector(NodeSelector)}.
*/
public interface NodeSelector {
Original file line number Diff line number Diff line change
@@ -55,32 +55,32 @@ public void testAny() {
assertEquals(expected, nodes);
}

public void testNotMasterOnly() {
Node masterOnly = dummyNode(true, false, false);
public void testNotClusterManagerOnly() {
Node clusterManagerOnly = dummyNode(true, false, false);
Node all = dummyNode(true, true, true);
Node masterAndData = dummyNode(true, true, false);
Node masterAndIngest = dummyNode(true, false, true);
Node clusterManagerAndData = dummyNode(true, true, false);
Node clusterManagerAndIngest = dummyNode(true, false, true);
Node coordinatingOnly = dummyNode(false, false, false);
Node ingestOnly = dummyNode(false, false, true);
Node data = dummyNode(false, true, randomBoolean());
List<Node> nodes = new ArrayList<>();
nodes.add(masterOnly);
nodes.add(clusterManagerOnly);
nodes.add(all);
nodes.add(masterAndData);
nodes.add(masterAndIngest);
nodes.add(clusterManagerAndData);
nodes.add(clusterManagerAndIngest);
nodes.add(coordinatingOnly);
nodes.add(ingestOnly);
nodes.add(data);
Collections.shuffle(nodes, getRandom());
List<Node> expected = new ArrayList<>(nodes);
expected.remove(masterOnly);
expected.remove(clusterManagerOnly);
NodeSelector.SKIP_DEDICATED_MASTERS.select(nodes);
assertEquals(expected, nodes);
}

private static Node dummyNode(boolean master, boolean data, boolean ingest) {
private static Node dummyNode(boolean clusterManager, boolean data, boolean ingest) {
final Set<String> roles = new TreeSet<>();
if (master) {
if (clusterManager) {
roles.add("master");
}
if (data) {
Original file line number Diff line number Diff line change
@@ -268,9 +268,9 @@ private static Node readNode(String nodeId, JsonParser parser, Scheme scheme) th
* attributes.
*/
boolean clientAttribute = v2RoleAttributeValue(realAttributes, "client", false);
Boolean masterAttribute = v2RoleAttributeValue(realAttributes, "master", null);
Boolean clusterManagerAttribute = v2RoleAttributeValue(realAttributes, "master", null);
Boolean dataAttribute = v2RoleAttributeValue(realAttributes, "data", null);
if ((masterAttribute == null && false == clientAttribute) || masterAttribute) {
if ((clusterManagerAttribute == null && false == clientAttribute) || clusterManagerAttribute) {
roles.add("master");
}
if ((dataAttribute == null && false == clientAttribute) || dataAttribute) {
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -118,18 +118,18 @@ public void testReindex() throws Exception {
public void testReindexFromRemote() throws Exception {
Function<Client, AbstractBulkByScrollRequestBuilder<?, ?>> function = client -> {
/*
* Use the master node for the reindex from remote because that node
* Use the clustermanager node for the reindex from remote because that node
* doesn't have a copy of the data on it.
*/
NodeInfo masterNode = null;
NodeInfo clusterManagerNode = null;
for (NodeInfo candidate : client.admin().cluster().prepareNodesInfo().get().getNodes()) {
if (candidate.getNode().isMasterNode()) {
masterNode = candidate;
clusterManagerNode = candidate;
}
}
assertNotNull(masterNode);
assertNotNull(clusterManagerNode);

TransportAddress address = masterNode.getInfo(HttpInfo.class).getAddress().publishAddress();
TransportAddress address = clusterManagerNode.getInfo(HttpInfo.class).getAddress().publishAddress();
RemoteInfo remote = new RemoteInfo(
"http",
address.getAddress(),
@@ -262,8 +262,8 @@ private CyclicBarrier blockExecutor(String name, String node) throws Exception {
*/
private BulkByScrollTask.Status taskStatus(String action) {
/*
* We always use the master client because we always start the test requests on the
* master. We do this simply to make sure that the test request is not started on the
* We always use the clustermanager client because we always start the test requests on the
* clustermanager. We do this simply to make sure that the test request is not started on the
* node who's queue we're manipulating.
*/
ListTasksResponse response = client().admin().cluster().prepareListTasks().setActions(action).setDetailed(true).get();
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@
routing: foo
refresh: true

# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
@@ -169,7 +169,7 @@
body: { "text": "test" }
refresh: true

# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
@@ -236,7 +236,7 @@
body: { "text": "test" }
refresh: true

# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
@@ -302,7 +302,7 @@
body: { "text": "test" }
refresh: true

# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
@@ -358,7 +358,7 @@
body: { "text": "test" }
refresh: true

# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
@@ -411,7 +411,7 @@
body: { "text": "test", "filtered": "removed" }
refresh: true

# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
@@ -480,7 +480,7 @@
indices.refresh: {}


# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ setup:

---
"Reindex from remote with parent join field":
# Fetch the http host. We use the host of the master because we know there will always be a master.
# Fetch the http host. We use the host of the clustermanager because we know there will always be a clustermanager.
- do:
cluster.state: {}
- set: { master_node: master }
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ teardown:
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@
*/
@ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0)
public class Ec2DiscoveryUpdateSettingsTests extends AbstractAwsTestCase {
public void testMinimumMasterNodesStart() {
public void testMinimumClusterManagerNodesStart() {
Settings nodeSettings = Settings.builder().put(DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "ec2").build();
internalCluster().startNode(nodeSettings);

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
reason: "contains is a newly added assertion"
features: contains

# Get master node id
# Get clustermanager node id
- do:
cluster.state: {}
- set: { master_node: master }
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
- do:
cluster.state: {}

# Get master node id
# Get clustermanager node id
- set: { master_node: master }

- do:
Original file line number Diff line number Diff line change
@@ -438,17 +438,17 @@ private Nodes buildNodeAndVersions() throws IOException {

final class Nodes extends HashMap<String, Node> {

private String masterNodeId = null;
private String clusterManagerNodeId = null;

public Node getMaster() {
return get(masterNodeId);
return get(clusterManagerNodeId);
}

public void setMasterNodeId(String id) {
if (get(id) == null) {
throw new IllegalArgumentException("node with id [" + id + "] not found. got:" + toString());
}
masterNodeId = id;
clusterManagerNodeId = id;
}

public void add(Node node) {
@@ -483,7 +483,7 @@ public Node getSafe(String id) {
@Override
public String toString() {
return "Nodes{" +
"masterNodeId='" + masterNodeId + "'\n" +
"masterNodeId='" + clusterManagerNodeId + "'\n" +
values().stream().map(Node::toString).collect(Collectors.joining("\n")) +
'}';
}