You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2015/07/28 15:58:03 UTC
cassandra git commit: loadConfig() called twice on startup
Repository: cassandra
Updated Branches:
refs/heads/trunk ad8cad7c4 -> de420e50e
loadConfig() called twice on startup
patch by Robert Stupp; reviewed by Jonathan Ellis for CASSANDRA-9853
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/de420e50
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/de420e50
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/de420e50
Branch: refs/heads/trunk
Commit: de420e50e819343fa1a5336324f7309870e52175
Parents: ad8cad7
Author: Robert Stupp <sn...@snazy.de>
Authored: Tue Jul 28 15:56:46 2015 +0200
Committer: Robert Stupp <sn...@snazy.de>
Committed: Tue Jul 28 15:56:46 2015 +0200
----------------------------------------------------------------------
.../apache/cassandra/config/YamlConfigurationLoader.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/de420e50/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
index d2a50e7..917eaeb 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -55,7 +55,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
/**
* Inspect the classpath to find storage configuration file
*/
- static URL getStorageConfigURL() throws ConfigurationException
+ private static URL getStorageConfigURL() throws ConfigurationException
{
String configUrl = System.getProperty("cassandra.config");
if (configUrl == null)
@@ -84,20 +84,24 @@ public class YamlConfigurationLoader implements ConfigurationLoader
}
}
+ logger.info("Configuration location: {}", url);
+
return url;
}
+ private static final URL storageConfigURL = getStorageConfigURL();
+
@Override
public Config loadConfig() throws ConfigurationException
{
- return loadConfig(getStorageConfigURL());
+ return loadConfig(storageConfigURL);
}
public Config loadConfig(URL url) throws ConfigurationException
{
try
{
- logger.info("Loading settings from {}", url);
+ logger.debug("Loading settings from {}", url);
byte[] configBytes;
try (InputStream is = url.openStream())
{