cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/3] git commit: Drop CQL3 obsolete keywords support in CREATE
Date Fri, 09 Aug 2013 15:53:17 GMT
Updated Branches:
  refs/heads/trunk 70c0d30df -> 1b750ad4c


Drop CQL3 obsolete keywords support in CREATE


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

Branch: refs/heads/trunk
Commit: 2bcfab03c6621114178cd3c248667373bc6a970a
Parents: d044fe6
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Fri Aug 9 17:51:53 2013 +0200
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Fri Aug 9 17:51:53 2013 +0200

----------------------------------------------------------------------
 pylib/cqlshlib/cql3handling.py                  | 17 +-------------
 .../org/apache/cassandra/cql3/CFPropDefs.java   | 24 +++++---------------
 .../org/apache/cassandra/cql3/KSPropDefs.java   |  8 +++----
 3 files changed, 10 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bcfab03/pylib/cqlshlib/cql3handling.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index c370363..ce8f9c6 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -84,22 +84,7 @@ class Cql3ParsingRuleSet(CqlParsingRuleSet):
             ('sstable_compression', 'chunk_length_kb', 'crc_check_chance')),
     )
 
-    obsolete_cf_options = (
-        'compaction_parameters',
-        'compaction_strategy_class',
-        'compaction_strategy_options',
-        'compression_parameters',
-        'key_cache_save_period_in_seconds',
-        'key_cache_size',
-        'max_compaction_threshold',
-        'memtable_flush_after_mins',
-        'memtable_operations_in_millions',
-        'memtable_throughput_in_mb',
-        'min_compaction_threshold',
-        'row_cache_provider',
-        'row_cache_save_period_in_seconds',
-        'row_cache_size',
-    )
+    obsolete_cf_options = ()
 
     consistency_levels = (
         'ANY',

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bcfab03/src/java/org/apache/cassandra/cql3/CFPropDefs.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/CFPropDefs.java b/src/java/org/apache/cassandra/cql3/CFPropDefs.java
index 94b22ff..d369617 100644
--- a/src/java/org/apache/cassandra/cql3/CFPropDefs.java
+++ b/src/java/org/apache/cassandra/cql3/CFPropDefs.java
@@ -19,9 +19,6 @@ package org.apache.cassandra.cql3;
 
 import java.util.*;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.CFMetaData.SpeculativeRetry;
 import org.apache.cassandra.db.compaction.AbstractCompactionStrategy;
@@ -31,8 +28,6 @@ import org.apache.cassandra.io.compress.CompressionParameters;
 
 public class CFPropDefs extends PropertyDefinitions
 {
-    private static final Logger logger = LoggerFactory.getLogger(CFPropDefs.class);
-
     public static final String KW_COMMENT = "comment";
     public static final String KW_READREPAIRCHANCE = "read_repair_chance";
     public static final String KW_DCLOCALREADREPAIRCHANCE = "dclocal_read_repair_chance";
@@ -53,8 +48,8 @@ public class CFPropDefs extends PropertyDefinitions
 
     public static final String COMPACTION_STRATEGY_CLASS_KEY = "class";
 
-    public static final Set<String> keywords = new HashSet<String>();
-    public static final Set<String> obsoleteKeywords = new HashSet<String>();
+    public static final Set<String> keywords = new HashSet<>();
+    public static final Set<String> obsoleteKeywords = new HashSet<>();
 
     static
     {
@@ -72,13 +67,6 @@ public class CFPropDefs extends PropertyDefinitions
         keywords.add(KW_COMPACTION);
         keywords.add(KW_COMPRESSION);
         keywords.add(KW_MEMTABLE_FLUSH_PERIOD);
-
-        obsoleteKeywords.add("compaction_strategy_class");
-        obsoleteKeywords.add("compaction_strategy_options");
-        obsoleteKeywords.add("min_compaction_threshold");
-        obsoleteKeywords.add("max_compaction_threshold");
-        obsoleteKeywords.add("compaction_parameters");
-        obsoleteKeywords.add("compression_parameters");
     }
 
     private Class<? extends AbstractCompactionStrategy> compactionStrategyClass = null;
@@ -111,7 +99,7 @@ public class CFPropDefs extends PropertyDefinitions
             if (compressionOptions.containsKey(CompressionParameters.CHUNK_LENGTH_KB))
                 chunkLength = CompressionParameters.parseChunkLength(compressionOptions.get(CompressionParameters.CHUNK_LENGTH_KB));
 
-            Map<String, String> remainingOptions = new HashMap<String, String>(compressionOptions);
+            Map<String, String> remainingOptions = new HashMap<>(compressionOptions);
             remainingOptions.remove(CompressionParameters.SSTABLE_COMPRESSION);
             remainingOptions.remove(CompressionParameters.CHUNK_LENGTH_KB);
             CompressionParameters cp = new CompressionParameters(sstableCompressionClass,
chunkLength, remainingOptions);
@@ -133,7 +121,7 @@ public class CFPropDefs extends PropertyDefinitions
     {
         Map<String, String> compactionOptions = getMap(KW_COMPACTION);
         if (compactionOptions == null)
-            return Collections.<String, String>emptyMap();
+            return new HashMap<>();
         return compactionOptions;
     }
 
@@ -141,7 +129,7 @@ public class CFPropDefs extends PropertyDefinitions
     {
         Map<String, String> compressionOptions = getMap(KW_COMPRESSION);
         if (compressionOptions == null)
-            return new HashMap<String, String>();
+            return new HashMap<>();
         return compressionOptions;
     }
 
@@ -170,7 +158,7 @@ public class CFPropDefs extends PropertyDefinitions
         if (compactionStrategyClass != null)
         {
             cfm.compactionStrategyClass(compactionStrategyClass);
-            cfm.compactionStrategyOptions(new HashMap<String, String>(getCompactionOptions()));
+            cfm.compactionStrategyOptions(new HashMap<>(getCompactionOptions()));
         }
 
         cfm.bloomFilterFpChance(getDouble(KW_BF_FP_CHANCE, cfm.getBloomFilterFpChance()));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2bcfab03/src/java/org/apache/cassandra/cql3/KSPropDefs.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/KSPropDefs.java b/src/java/org/apache/cassandra/cql3/KSPropDefs.java
index 9bf4070..c10a79b 100644
--- a/src/java/org/apache/cassandra/cql3/KSPropDefs.java
+++ b/src/java/org/apache/cassandra/cql3/KSPropDefs.java
@@ -29,15 +29,13 @@ public class KSPropDefs extends PropertyDefinitions
 
     public static final String REPLICATION_STRATEGY_CLASS_KEY = "class";
 
-    public static final Set<String> keywords = new HashSet<String>();
-    public static final Set<String> obsoleteKeywords = new HashSet<String>();
+    public static final Set<String> keywords = new HashSet<>();
+    public static final Set<String> obsoleteKeywords = new HashSet<>();
 
     static
     {
         keywords.add(KW_DURABLE_WRITES);
         keywords.add(KW_REPLICATION);
-
-        obsoleteKeywords.add("strategy_class");
     }
 
     private String strategyClass;
@@ -58,7 +56,7 @@ public class KSPropDefs extends PropertyDefinitions
     {
         Map<String, String> replicationOptions = getMap(KW_REPLICATION);
         if (replicationOptions == null)
-            return Collections.<String, String>emptyMap();
+            return Collections.emptyMap();
         return replicationOptions;
     }
 


Mime
View raw message