in common/src/main/java/org/apache/cassandra/sidecar/cluster/InstancesConfigImpl.java [77:101]
public InstanceMetadata instanceFromHost(String host) throws NoSuchElementException
{
InstanceMetadata instanceMetadata = hostToInstanceMetadata.get(host);
if (instanceMetadata == null)
{
try
{
instanceMetadata = hostToInstanceMetadata.get(dnsResolver.resolve(host));
}
catch (UnknownHostException e)
{
NoSuchElementException error = new NoSuchElementException("Instance with host address "
+ host +
" not found, and an error occurred when " +
"attempting to resolve its IP address.");
error.initCause(e);
throw error;
}
if (instanceMetadata == null)
{
throw new NoSuchElementException("Instance with host address " + host + " not found");
}
}
return instanceMetadata;
}