cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] git commit: add file:/// on Windows to -Dcassandra.config value patch by Marco Tulio Avila Cerón; reviewed by Lyuben Todorov for CASSANDRA-7398
Date Wed, 18 Jun 2014 19:05:51 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 d6322a7ec -> 498ee24b5
  refs/heads/trunk 340ce90e9 -> ba83acd02


add file:/// on Windows to -Dcassandra.config value
patch by Marco Tulio Avila Cerón; reviewed by Lyuben Todorov for CASSANDRA-7398


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/498ee24b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/498ee24b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/498ee24b

Branch: refs/heads/cassandra-2.1
Commit: 498ee24b52a6876a008c3d3d3ef4870e4bd9842c
Parents: d6322a7
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Jun 18 14:05:31 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Jun 18 14:05:31 2014 -0500

----------------------------------------------------------------------
 .../apache/cassandra/config/YamlConfigurationLoader.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/498ee24b/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 4a1280c..e5885b1 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -33,6 +33,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.utils.FBUtilities;
 import org.yaml.snakeyaml.TypeDescription;
 import org.yaml.snakeyaml.Yaml;
 import org.yaml.snakeyaml.error.YAMLException;
@@ -45,6 +46,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
     private static final Logger logger = LoggerFactory.getLogger(YamlConfigurationLoader.class);
 
     private final static String DEFAULT_CONFIGURATION = "cassandra.yaml";
+    private static final String FILE_PREFIX = "file:///";
 
     /**
      * Inspect the classpath to find storage configuration file
@@ -53,7 +55,15 @@ public class YamlConfigurationLoader implements ConfigurationLoader
     {
         String configUrl = System.getProperty("cassandra.config");
         if (configUrl == null)
+        {
             configUrl = DEFAULT_CONFIGURATION;
+        }
+        else if (!FBUtilities.isUnix() && !configUrl.startsWith(FILE_PREFIX))
+        {
+            String format = "Non-unix environment detected, %s prefix not supplied at the
beginning of file path but is required. Changing path to %s";
+            configUrl = FILE_PREFIX + configUrl;
+            logger.warn(String.format(format, FILE_PREFIX, configUrl));
+        }
 
         URL url;
         try


Mime
View raw message