use of com.pamirs.attach.plugin.es.shadowserver.utils.HostAndPort in project LinkAgent by shulieTech.
the class AbstractTransportClientDefinition method addPtTransportAddress.
protected void addPtTransportAddress(TransportClient transportClient, ShadowEsServerConfig shadowEsServerConfig) {
for (String performanceTestNode : shadowEsServerConfig.getPerformanceTestNodes()) {
try {
HostAndPort hostAndPort = new HostAndPort(performanceTestNode);
transportClient.addTransportAddress(hostAndPort.toTransportAddress());
} catch (UnknownHostException e) {
throw new PressureMeasureError("影子sever nodes配置错误!", e);
}
}
}
use of com.pamirs.attach.plugin.es.shadowserver.utils.HostAndPort in project LinkAgent by shulieTech.
the class AbstractRestClientDefinition method solve.
@Override
public RestClient solve(RestClient target, ShadowEsServerConfig shadowEsServerConfig) {
HttpHost[] httpHosts = new HttpHost[shadowEsServerConfig.getPerformanceTestNodes().size()];
for (int i = 0; i < shadowEsServerConfig.getPerformanceTestNodes().size(); i++) {
httpHosts[i] = new HostAndPort(shadowEsServerConfig.getPerformanceTestNodes().get(i)).toHttpHost();
}
RestClientBuilder builder = RestClient.builder(httpHosts);
assembleBuilder(target, builder);
return builder.build();
}
Aggregations