Skip to content

Commit

Permalink
Correction after code review, removed some comments and one javadoc a…
Browse files Browse the repository at this point in the history
…dded.

Signed-off-by: Lukasz Soszynski <[email protected]>
  • Loading branch information
lukasz-soszynski-eliatra committed Sep 19, 2022
1 parent 6e5e885 commit 9fdb73a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
import static org.opensearch.test.framework.cluster.NodeType.DATA;

public enum ClusterManager {
//first one needs to be a cluster manager
//HUGE(new NodeSettings(true, false, false), new NodeSettings(true, false, false), new NodeSettings(true, false, false), new NodeSettings(false, true,false), new NodeSettings(false, true, false)),

//3 nodes (1m, 2d)
DEFAULT(new NodeSettings(true, false), new NodeSettings(false, true), new NodeSettings(false, true)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.common.util.concurrent.ThreadContext.StoredContext;

/**
* The class adds provided headers into context before sending request via wrapped {@link Client}
*/
public class ContextHeaderDecoratorClient extends FilterClient {

private Map<String, String> headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public NodeSettingsSupplier minimumOpenSearchSettingsSslOnly(Settings other) {
private Settings.Builder minimumOpenSearchSettingsBuilder(int node, boolean sslOnly) {

Settings.Builder builder = Settings.builder();

// TODO: At the moment the test node certificates have an OID set, so we do not need to
// specify any node_dns here. Once we make generating and specifying

builder.put("plugins.security.ssl.transport.pemtrustedcas_filepath", testCertificates.getRootCertificate().getAbsolutePath());
builder.put("plugins.security.ssl.transport.pemcert_filepath", testCertificates.getNodeCertificate(node).getAbsolutePath());
builder.put("plugins.security.ssl.transport.pemkey_filepath", testCertificates.getNodeKey(node).getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,6 @@ int findAvailablePort(int minPort, int maxPort) {
* @throws IllegalStateException if the requested number of available ports could not be found
*/
SortedSet<Integer> findAvailablePorts(int numRequested, int minPort, int maxPort) {
//Assert.isTrue(minPort > 0, "'minPort' must be greater than 0");
//Assert.isTrue(maxPort > minPort, "'maxPort' must be greater than 'minPort'");
//Assert.isTrue(maxPort <= PORT_RANGE_MAX, "'maxPort' must be less than or equal to " + PORT_RANGE_MAX);
//Assert.isTrue(numRequested > 0, "'numRequested' must be greater than 0");
//Assert.isTrue((maxPort - minPort) >= numRequested,
// "'numRequested' must not be greater than 'maxPort' - 'minPort'");

SortedSet<Integer> availablePorts = new TreeSet<>();
int attemptCount = 0;
while ((++attemptCount <= numRequested + 100) && availablePorts.size() < numRequested) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.opensearch.test.framework.cluster;

/*
* Copyright 2002-2020 the original author or authors.
*
Expand Down Expand Up @@ -27,6 +25,8 @@
* GitHub history for details.
*/

package org.opensearch.test.framework.cluster;

import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.ServerSocket;
Expand Down

0 comments on commit 9fdb73a

Please sign in to comment.