jacek-lewandowski commented on code in PR #2458:
URL: https://github.com/apache/cassandra/pull/2458#discussion_r1259500502
##########
src/java/org/apache/cassandra/locator/AbstractCloudMetadataServiceConnector.java:
##########
@@ -22,25 +22,55 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.Map;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
+import org.apache.cassandra.exceptions.ConfigurationException;
+
import static java.nio.charset.StandardCharsets.UTF_8;
abstract class AbstractCloudMetadataServiceConnector
{
+ static final String METADATA_URL_PROPERTY = "metadata_url";
+
+ public static class DefaultCloudMetadataServiceConnector extends
AbstractCloudMetadataServiceConnector
+ {
+ protected DefaultCloudMetadataServiceConnector(String
metadataServiceUrl)
+ {
+ super(metadataServiceUrl);
+ }
+ }
+
protected final String metadataServiceUrl;
+ @VisibleForTesting // for mockito
+ protected String getMetadataServiceUrl()
+ {
+ return metadataServiceUrl;
+ }
+
protected AbstractCloudMetadataServiceConnector(String metadataServiceUrl)
{
+ try
+ {
+ URL url = new URL(metadataServiceUrl);
+ url.toURI();
+ }
+ catch (MalformedURLException | IllegalArgumentException |
URISyntaxException ex)
+ {
+ throw new ConfigurationException(String.format("URL you provided
(%s) is not valid!", metadataServiceUrl), ex);
Review Comment:
Maybe something like:
Snitch metadata service URL '%s' is invalid. Please review snitch properties
defined in the 'cassandra-rackdc.properties' configuration file.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]