Rename reference to project OpenSearch was forked from (#2483)

Fixing log message and renaming internal variable.
Improving internal JavaDoc.

Signed-off-by: Lukáš Vlček <lukas.vlcek@aiven.io>
This commit is contained in:
Lukáš Vlček 2022-03-16 18:03:22 +01:00 committed by GitHub
parent 77d106015f
commit 02ffd4c548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 3 deletions

View File

@ -143,10 +143,15 @@ public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTe
validateSpec(restSpec); validateSpec(restSpec);
final List<HttpHost> hosts = getClusterHosts(); final List<HttpHost> hosts = getClusterHosts();
Tuple<Version, Version> versionVersionTuple = readVersionsFromCatNodes(adminClient()); Tuple<Version, Version> versionVersionTuple = readVersionsFromCatNodes(adminClient());
final Version esVersion = versionVersionTuple.v1(); final Version minVersion = versionVersionTuple.v1();
final Version masterVersion = versionVersionTuple.v2(); final Version masterVersion = versionVersionTuple.v2();
logger.info("initializing client, minimum es version [{}], master version, [{}], hosts {}", esVersion, masterVersion, hosts); logger.info(
clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, esVersion, masterVersion); "initializing client, minimum OpenSearch version [{}], master version, [{}], hosts {}",
minVersion,
masterVersion,
hosts
);
clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion);
restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType()); restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType());
adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false); adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false);
final String[] denylist = resolvePathsProperty(REST_TESTS_BLACKLIST, null); final String[] denylist = resolvePathsProperty(REST_TESTS_BLACKLIST, null);
@ -321,6 +326,13 @@ public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTe
} }
} }
/**
* Detect minimal node version and master node version of cluster using REST Client.
*
* @param restClient REST client used to discover cluster nodes
* @return {@link Tuple} of [minimal node version, master node version]
* @throws IOException When _cat API output parsing fails
*/
private Tuple<Version, Version> readVersionsFromCatNodes(RestClient restClient) throws IOException { private Tuple<Version, Version> readVersionsFromCatNodes(RestClient restClient) throws IOException {
// we simply go to the _cat/nodes API and parse all versions in the cluster // we simply go to the _cat/nodes API and parse all versions in the cluster
final Request request = new Request("GET", "/_cat/nodes"); final Request request = new Request("GET", "/_cat/nodes");