in flink-connector-opensearch/src/main/java/org/apache/flink/connector/opensearch/table/OpensearchConfiguration.java [138:162]
private static HttpHost validateAndParseHostsString(String host) {
try {
HttpHost httpHost = HttpHost.create(host);
if (httpHost.getPort() < 0) {
throw new ValidationException(
String.format(
"Could not parse host '%s' in option '%s'. It should follow the format 'http://host_name:port'. Missing port.",
host, HOSTS_OPTION.key()));
}
if (httpHost.getSchemeName() == null) {
throw new ValidationException(
String.format(
"Could not parse host '%s' in option '%s'. It should follow the format 'http://host_name:port'. Missing scheme.",
host, HOSTS_OPTION.key()));
}
return httpHost;
} catch (Exception e) {
throw new ValidationException(
String.format(
"Could not parse host '%s' in option '%s'. It should follow the format 'http://host_name:port'.",
host, HOSTS_OPTION.key()),
e);
}
}