Skip to content

Commit

Permalink
Replace non-inclusive terms from configuration settings
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied authored and lukasz-soszynski-eliatra committed Sep 5, 2022
1 parent be0d933 commit cb5418e
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import com.google.common.collect.ImmutableList;
import com.google.common.net.InetAddresses;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -270,7 +271,7 @@ public void waitForCluster(ClusterHealthStatus status, TimeValue timeout, int ex
AdminClient adminClient = client.admin();

final ClusterHealthResponse healthResponse = adminClient.cluster().prepareHealth().setWaitForStatus(status).setTimeout(timeout)
.setMasterNodeTimeout(timeout).setWaitForNodes("" + expectedNodeCount).execute().actionGet();
.setClusterManagerNodeTimeout(timeout).setWaitForNodes("" + expectedNodeCount).execute().actionGet();

if (log.isDebugEnabled()) {
log.debug("Current ClusterState:\n{}", Strings.toString(healthResponse));
Expand Down Expand Up @@ -462,9 +463,9 @@ private Settings getOpenSearchSettings() {
}

private Settings getMinimalOpenSearchSettings() {
return Settings.builder().put("node.name", nodeName).put("node.data", nodeSettings.dataNode).put("node.master", nodeSettings.clusterManagerNode)
return Settings.builder().put("node.name", nodeName).putList("node.roles", createNodeRolesSettings())
.put("cluster.name", clusterName).put("path.home", nodeHomeDir.toPath()).put("path.data", dataDir.toPath())
.put("path.logs", logsDir.toPath()).putList("cluster.initial_master_nodes", initialClusterManagerHosts)
.put("path.logs", logsDir.toPath()).putList("cluster.initial_cluster_manager_nodes", initialClusterManagerHosts)
.put("discovery.initial_state_timeout", "8s").putList("discovery.seed_hosts", seedHosts).put("transport.tcp.port", transportPort)
.put("http.port", httpPort).put("cluster.routing.allocation.disk.threshold_enabled", false)
.put("discovery.probe.connect_timeout", "10s").put("discovery.probe.handshake_timeout", "10s").put("http.cors.enabled", true)
Expand All @@ -473,6 +474,17 @@ private Settings getMinimalOpenSearchSettings() {
.build();
}

private List<String> createNodeRolesSettings() {
final ImmutableList.Builder<String> nodeRolesBuilder = ImmutableList.<String>builder();
if (nodeSettings.dataNode) {
nodeRolesBuilder.add("data");
}
if (nodeSettings.clusterManagerNode) {
nodeRolesBuilder.add("cluster_manager");
}
return nodeRolesBuilder.build();
}

@Override
public String getClusterName() {
return clusterName;
Expand Down

0 comments on commit cb5418e

Please sign in to comment.