mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-23 07:34:31 -06:00
update
This commit is contained in:
parent
6db678cb05
commit
2aee87fe3a
@ -61,38 +61,40 @@ public class OpenSearchSpace implements AutoCloseable {
|
|||||||
|
|
||||||
|
|
||||||
SdkAsyncHttpClient httpClient =
|
SdkAsyncHttpClient httpClient =
|
||||||
AwsCrtAsyncHttpClient.builder()
|
AwsCrtAsyncHttpClient.builder()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
AwsSdk2TransportOptions.Builder transportOptionsBuilder
|
AwsSdk2TransportOptions.Builder transportOptionsBuilder
|
||||||
= AwsSdk2TransportOptions.builder();
|
= AwsSdk2TransportOptions.builder();
|
||||||
|
|
||||||
cfg.getOptional("profile").map(
|
cfg.getOptional("profile").map(
|
||||||
p -> ProfileCredentialsProvider.builder()
|
p -> ProfileCredentialsProvider.builder()
|
||||||
.profileName(p)
|
.profileName(p)
|
||||||
.build())
|
.build())
|
||||||
.ifPresent(transportOptionsBuilder::setCredentials);
|
.ifPresent(transportOptionsBuilder::setCredentials);
|
||||||
|
|
||||||
AwsSdk2TransportOptions transportOptions = transportOptionsBuilder.build();
|
AwsSdk2TransportOptions transportOptions = transportOptionsBuilder.build();
|
||||||
|
|
||||||
AwsOsServiceType svctype = AwsOsServiceType.valueOf(cfg.get("svctype"));
|
AwsOsServiceType svctype = AwsOsServiceType.valueOf(cfg.get("svctype"));
|
||||||
|
|
||||||
AwsSdk2Transport awsSdk2Transport =
|
AwsSdk2Transport awsSdk2Transport =
|
||||||
new AwsSdk2Transport(
|
new AwsSdk2Transport(
|
||||||
httpClient,
|
httpClient,
|
||||||
host,
|
host,
|
||||||
svctype.name(),
|
svctype.name(),
|
||||||
selectedRegion,
|
selectedRegion,
|
||||||
transportOptions
|
transportOptions
|
||||||
);
|
);
|
||||||
|
|
||||||
OpenSearchClient client = new OpenSearchClient(awsSdk2Transport);
|
OpenSearchClient client = new OpenSearchClient(awsSdk2Transport);
|
||||||
|
|
||||||
try {
|
if (cfg.get("getinfo").equals("true")) {
|
||||||
InfoResponse info = client.info();
|
try {
|
||||||
System.out.println(info.version().distribution() + ": " + info.version().number());
|
InfoResponse info = client.info();
|
||||||
} catch (IOException e) {
|
System.out.println(info.version().distribution() + ": " + info.version().number());
|
||||||
throw new RuntimeException(e);
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
@ -100,15 +102,17 @@ public class OpenSearchSpace implements AutoCloseable {
|
|||||||
|
|
||||||
public static NBConfigModel getConfigModel() {
|
public static NBConfigModel getConfigModel() {
|
||||||
return ConfigModel.of(OpenSearchSpace.class)
|
return ConfigModel.of(OpenSearchSpace.class)
|
||||||
.add(Param.required("region", String.class).setDescription("The region to connect to"))
|
.add(Param.required("region", String.class).setDescription("The region to connect to"))
|
||||||
.add(Param.required("host", String.class).setDescription("The Open Search API endpoint host"))
|
.add(Param.required("host", String.class).setDescription("The Open Search API endpoint host"))
|
||||||
.add(Param.optional("profile")
|
.add(Param.optional("profile")
|
||||||
.setDescription("The AWS auth profile to use. Required to activate profile based auth"))
|
.setDescription("The AWS auth profile to use. Required to activate profile based auth"))
|
||||||
.add(Param.defaultTo("svctype", "es")
|
.add(Param.defaultTo("getinfo", "false").setDescription("whether to call info after connect or " +
|
||||||
.setDescription("one of es or aoss, defaults to es for OpenSearch domains"))
|
"not, true|false"))
|
||||||
.add(Param.defaultTo("diag","false")
|
.add(Param.defaultTo("svctype", "es")
|
||||||
|
.setDescription("one of es or aoss, defaults to es for OpenSearch domains"))
|
||||||
|
.add(Param.defaultTo("diag", "false")
|
||||||
.setDescription("enable payload diagnostics or not"))
|
.setDescription("enable payload diagnostics or not"))
|
||||||
.asReadOnly();
|
.asReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user