shikhasomani commented on a change in pull request #1447: Calcite-3335: Getting
new parameter from model to set it in HTTP host…
URL: https://github.com/apache/calcite/pull/1447#discussion_r322841341
##########
File path:
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSchemaFactory.java
##########
@@ -89,6 +101,25 @@ private static RestClient connect(Map<String, Integer>
coordinates) {
return RestClient.builder(set.toArray(new HttpHost[0])).build();
}
+ /**
+ * Builds elastic rest client from user configuration
+ * @param hosts list of {@code scheme://hostname/port} to connect to
+ * @return newly initialized low-level rest http client for ES
+ */
+ private static RestClient connect(List<String> hosts) throws
MalformedURLException {
+ Objects.requireNonNull(hosts, "hosts");
+ Preconditions.checkArgument(!hosts.isEmpty(), "no ES hosts specified");
+ final Set<HttpHost> set = new LinkedHashSet<>();
+
+ for (String host: hosts) {
+ URL hostURL = new URL(host);
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services