You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/09/03 19:13:04 UTC
[1/5] git commit: Improve error message when yaml contains invalid
properties patch by Mikhail Stepura; reviewed by jbellis for CASSANDRA-5958
Updated Branches:
refs/heads/cassandra-2.0 a3534910e -> 31f6ec1bf
refs/heads/trunk 5ea3b1538 -> e01186c21
Improve error message when yaml contains invalid properties
patch by Mikhail Stepura; reviewed by jbellis for CASSANDRA-5958
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/31f6ec1b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/31f6ec1b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/31f6ec1b
Branch: refs/heads/cassandra-2.0
Commit: 31f6ec1bf5ac642ea0e47e40e62add46901135fc
Parents: 760e68f
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Sep 3 12:11:40 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Sep 3 12:12:47 2013 -0500
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../config/YamlConfigurationLoader.java | 43 ++++++++++++++++++--
2 files changed, 41 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31f6ec1b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 40cd5ae..c09ba86 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
2.0.1
+ * Improve error message when yaml contains invalid properties (CASSANDRA-5958)
* Improve leveled compaction's ability to find non-overlapping L0 compactions
to work on concurrently (CASSANDRA-5921)
* Notify indexer of columns shadowed by range tombstones (CASSANDRA-5614)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31f6ec1b/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 642fe8b..d8a138c 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -17,19 +17,23 @@
*/
package org.apache.cassandra.config;
+import java.beans.IntrospectionException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.io.util.FileUtils;
-
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
+import org.yaml.snakeyaml.introspector.MissingProperty;
+import org.yaml.snakeyaml.introspector.Property;
+import org.yaml.snakeyaml.introspector.PropertyUtils;
public class YamlConfigurationLoader implements ConfigurationLoader
{
@@ -83,8 +87,12 @@ public class YamlConfigurationLoader implements ConfigurationLoader
TypeDescription seedDesc = new TypeDescription(SeedProviderDef.class);
seedDesc.putMapPropertyType("parameters", String.class, String.class);
constructor.addTypeDescription(seedDesc);
+ MissingPropertiesChecker propertiesChecker = new MissingPropertiesChecker();
+ constructor.setPropertyUtils(propertiesChecker);
Yaml yaml = new Yaml(constructor);
- return (Config)yaml.load(input);
+ Config result = yaml.loadAs(input, Config.class);
+ propertiesChecker.check();
+ return result;
}
catch (YAMLException e)
{
@@ -95,4 +103,33 @@ public class YamlConfigurationLoader implements ConfigurationLoader
FileUtils.closeQuietly(input);
}
}
+
+ private static class MissingPropertiesChecker extends PropertyUtils
+ {
+ private final Set<String> missingProperties = new HashSet<>();
+
+ public MissingPropertiesChecker()
+ {
+ setSkipMissingProperties(true);
+ }
+
+ @Override
+ public Property getProperty(Class<? extends Object> type, String name) throws IntrospectionException
+ {
+ Property result = super.getProperty(type, name);
+ if (result instanceof MissingProperty)
+ {
+ missingProperties.add(result.getName());
+ }
+ return result;
+ }
+
+ public void check() throws ConfigurationException
+ {
+ if (!missingProperties.isEmpty())
+ {
+ throw new ConfigurationException("Invalid yaml. Please remove properties " + missingProperties + " from your cassandra.yaml");
+ }
+ }
+ }
}
[3/5] git commit: Improve error message when yaml contains invalid
properties patch by Mikhail Stepura; reviewed by jbellis for CASSANDRA-5958
Posted by jb...@apache.org.
Improve error message when yaml contains invalid properties
patch by Mikhail Stepura; reviewed by jbellis for CASSANDRA-5958
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/31f6ec1b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/31f6ec1b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/31f6ec1b
Branch: refs/heads/trunk
Commit: 31f6ec1bf5ac642ea0e47e40e62add46901135fc
Parents: 760e68f
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Sep 3 12:11:40 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Sep 3 12:12:47 2013 -0500
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../config/YamlConfigurationLoader.java | 43 ++++++++++++++++++--
2 files changed, 41 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31f6ec1b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 40cd5ae..c09ba86 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
2.0.1
+ * Improve error message when yaml contains invalid properties (CASSANDRA-5958)
* Improve leveled compaction's ability to find non-overlapping L0 compactions
to work on concurrently (CASSANDRA-5921)
* Notify indexer of columns shadowed by range tombstones (CASSANDRA-5614)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31f6ec1b/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 642fe8b..d8a138c 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -17,19 +17,23 @@
*/
package org.apache.cassandra.config;
+import java.beans.IntrospectionException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.io.util.FileUtils;
-
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
+import org.yaml.snakeyaml.introspector.MissingProperty;
+import org.yaml.snakeyaml.introspector.Property;
+import org.yaml.snakeyaml.introspector.PropertyUtils;
public class YamlConfigurationLoader implements ConfigurationLoader
{
@@ -83,8 +87,12 @@ public class YamlConfigurationLoader implements ConfigurationLoader
TypeDescription seedDesc = new TypeDescription(SeedProviderDef.class);
seedDesc.putMapPropertyType("parameters", String.class, String.class);
constructor.addTypeDescription(seedDesc);
+ MissingPropertiesChecker propertiesChecker = new MissingPropertiesChecker();
+ constructor.setPropertyUtils(propertiesChecker);
Yaml yaml = new Yaml(constructor);
- return (Config)yaml.load(input);
+ Config result = yaml.loadAs(input, Config.class);
+ propertiesChecker.check();
+ return result;
}
catch (YAMLException e)
{
@@ -95,4 +103,33 @@ public class YamlConfigurationLoader implements ConfigurationLoader
FileUtils.closeQuietly(input);
}
}
+
+ private static class MissingPropertiesChecker extends PropertyUtils
+ {
+ private final Set<String> missingProperties = new HashSet<>();
+
+ public MissingPropertiesChecker()
+ {
+ setSkipMissingProperties(true);
+ }
+
+ @Override
+ public Property getProperty(Class<? extends Object> type, String name) throws IntrospectionException
+ {
+ Property result = super.getProperty(type, name);
+ if (result instanceof MissingProperty)
+ {
+ missingProperties.add(result.getName());
+ }
+ return result;
+ }
+
+ public void check() throws ConfigurationException
+ {
+ if (!missingProperties.isEmpty())
+ {
+ throw new ConfigurationException("Invalid yaml. Please remove properties " + missingProperties + " from your cassandra.yaml");
+ }
+ }
+ }
}
[4/5] git commit: cleanup
Posted by jb...@apache.org.
cleanup
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/760e68f7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/760e68f7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/760e68f7
Branch: refs/heads/trunk
Commit: 760e68f77c419f7eda3ac8eea59f42481d0f02f2
Parents: a353491
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Sep 3 12:10:44 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Sep 3 12:12:47 2013 -0500
----------------------------------------------------------------------
CHANGES.txt | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/760e68f7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 82fea75..40cd5ae 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -64,6 +64,11 @@ Merged from 1.2:
* Use index_interval from cassandra.yaml when upgraded (CASSANDRA-5822)
* Fix buffer underflow on socket close (CASSANDRA-5792)
Merged from 1.2:
+ * Fix reading DeletionTime from 1.1-format sstables (CASSANDRA-5814)
+ * cqlsh: add collections support to COPY (CASSANDRA-5698)
+ * retry important messages for any IOException (CASSANDRA-5804)
+ * Allow empty IN relations in SELECT/UPDATE/DELETE statements (CASSANDRA-5626)
+ * cqlsh: fix crashing on Windows due to libedit detection (CASSANDRA-5812)
* fix bulk-loading compressed sstables (CASSANDRA-5820)
* (Hadoop) fix quoting in CqlPagingRecordReader and CqlRecordWriter
(CASSANDRA-5824)
@@ -88,14 +93,6 @@ Merged from 1.1:
* Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
-1.2.8
- * Fix reading DeletionTime from 1.1-format sstables (CASSANDRA-5814)
- * cqlsh: add collections support to COPY (CASSANDRA-5698)
- * retry important messages for any IOException (CASSANDRA-5804)
- * Allow empty IN relations in SELECT/UPDATE/DELETE statements (CASSANDRA-5626)
- * cqlsh: fix crashing on Windows due to libedit detection (CASSANDRA-5812)
-
-
2.0.0-beta2
* Replace countPendingHints with Hints Created metric (CASSANDRA-5746)
* Allow nodetool with no args, and with help to run without a server (CASSANDRA-5734)
[5/5] git commit: Merge branch 'cassandra-2.0' into trunk
Posted by jb...@apache.org.
Merge branch 'cassandra-2.0' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e01186c2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e01186c2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e01186c2
Branch: refs/heads/trunk
Commit: e01186c21129d74432355d4262a9c490e6d54dbe
Parents: 5ea3b15 31f6ec1
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Sep 3 12:12:57 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Sep 3 12:12:57 2013 -0500
----------------------------------------------------------------------
CHANGES.txt | 14 +++----
.../config/YamlConfigurationLoader.java | 43 ++++++++++++++++++--
2 files changed, 46 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/e01186c2/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 02cb4bc,c09ba86..69cb2e6
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,9 -1,5 +1,10 @@@
+2.1
+ * change logging from log4j to logback (CASSANDRA-5883)
+ * switch to LZ4 compression for internode communication (CASSANDRA-5887)
+ * Stop using Thrift-generated Index* classes internally (CASSANDRA-5971)
+
2.0.1
+ * Improve error message when yaml contains invalid properties (CASSANDRA-5958)
* Improve leveled compaction's ability to find non-overlapping L0 compactions
to work on concurrently (CASSANDRA-5921)
* Notify indexer of columns shadowed by range tombstones (CASSANDRA-5614)
[2/5] git commit: cleanup
Posted by jb...@apache.org.
cleanup
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/760e68f7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/760e68f7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/760e68f7
Branch: refs/heads/cassandra-2.0
Commit: 760e68f77c419f7eda3ac8eea59f42481d0f02f2
Parents: a353491
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Sep 3 12:10:44 2013 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Sep 3 12:12:47 2013 -0500
----------------------------------------------------------------------
CHANGES.txt | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/760e68f7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 82fea75..40cd5ae 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -64,6 +64,11 @@ Merged from 1.2:
* Use index_interval from cassandra.yaml when upgraded (CASSANDRA-5822)
* Fix buffer underflow on socket close (CASSANDRA-5792)
Merged from 1.2:
+ * Fix reading DeletionTime from 1.1-format sstables (CASSANDRA-5814)
+ * cqlsh: add collections support to COPY (CASSANDRA-5698)
+ * retry important messages for any IOException (CASSANDRA-5804)
+ * Allow empty IN relations in SELECT/UPDATE/DELETE statements (CASSANDRA-5626)
+ * cqlsh: fix crashing on Windows due to libedit detection (CASSANDRA-5812)
* fix bulk-loading compressed sstables (CASSANDRA-5820)
* (Hadoop) fix quoting in CqlPagingRecordReader and CqlRecordWriter
(CASSANDRA-5824)
@@ -88,14 +93,6 @@ Merged from 1.1:
* Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
-1.2.8
- * Fix reading DeletionTime from 1.1-format sstables (CASSANDRA-5814)
- * cqlsh: add collections support to COPY (CASSANDRA-5698)
- * retry important messages for any IOException (CASSANDRA-5804)
- * Allow empty IN relations in SELECT/UPDATE/DELETE statements (CASSANDRA-5626)
- * cqlsh: fix crashing on Windows due to libedit detection (CASSANDRA-5812)
-
-
2.0.0-beta2
* Replace countPendingHints with Hints Created metric (CASSANDRA-5746)
* Allow nodetool with no args, and with help to run without a server (CASSANDRA-5734)