cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] git commit: Merge branch 'cassandra-1.1' into cassandra-1.2.0
Date Thu, 13 Dec 2012 20:04:14 GMT
Updated Branches:
  refs/heads/cassandra-1.2.0 347461375 -> f4018ea08


Merge branch 'cassandra-1.1' into cassandra-1.2.0

Conflicts:
	src/java/org/apache/cassandra/cql/CFPropDefs.java
	src/java/org/apache/cassandra/cql3/CFPropDefs.java
	src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java


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

Branch: refs/heads/cassandra-1.2.0
Commit: f4018ea089e0c282b694e372105425b80f7f652b
Parents: 3474613 01fcb8c
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Thu Dec 13 23:00:46 2012 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Dec 13 23:00:46 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 src/java/org/apache/cassandra/cql/CFPropDefs.java  |   25 ++++------
 .../cassandra/cql/CreateColumnFamilyStatement.java |    3 +
 src/java/org/apache/cassandra/cql3/CFPropDefs.java |   14 +-----
 .../statements/CreateColumnFamilyStatement.java    |   37 +++++++++------
 5 files changed, 37 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f4018ea0/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index e09e925,75c715c..d785616
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,69 -1,17 +1,70 @@@
 -1.1.8
 +1.2.0
 + * cqlsh: add DESCRIBE KEYSPACES command (CASSANDRA-5060)
 +Merged from 1.1:
   * fix temporarily missing schema after upgrade from pre-1.1.5 (CASSANDRA-5061)
++ * Fix ALTER TABLE overriding compression options with defaults (CASSANDRA-4996)
 +
 +
 +1.2-rc1
 + * rename rpc_timeout settings to request_timeout (CASSANDRA-5027)
 + * add BF with 0.1 FP to LCS by default (CASSANDRA-5029)
 + * Fix preparing insert queries (CASSANDRA-5016)
 + * Fix preparing queries with counter increment (CASSANDRA-5022)
 + * Fix preparing updates with collections (CASSANDRA-5017)
 + * Don't generate UUID based on other node address (CASSANDRA-5002)
 + * Fix message when trying to alter a clustering key type (CASSANDRA-5012)
 + * Update IAuthenticator to match the new IAuthorizer (CASSANDRA-5003)
 + * Fix inserting only a key in CQL3 (CASSANDRA-5040)
 + * Fix CQL3 token() function when used with strings (CASSANDRA-5050)
 +Merged from 1.1:
   * reduce log spam from invalid counter shards (CASSANDRA-5026)
   * Improve schema propagation performance (CASSANDRA-5025)
 - * Fall back to old describe_splits if d_s_ex is not available (CASSANDRA-4803)
 - * Improve error reporting when streaming ranges fail (CASSANDRA-5009)
 + * Fix for IndexHelper.IndexFor throws OOB Exception (CASSANDRA-5030)
 + * cqlsh: make it possible to describe thrift CFs (CASSANDRA-4827)
   * cqlsh: fix timestamp formatting on some platforms (CASSANDRA-5046)
 - * Fix ALTER TABLE overriding compression options with defaults (CASSANDRA-4996)
  
  
 -1.1.7
 - * cqlsh: improve COPY FROM performance (CASSANDRA-4921)
 +1.2-beta3
 + * make consistency level configurable in cqlsh (CASSANDRA-4829)
 + * fix cqlsh rendering of blob fields (CASSANDRA-4970)
 + * fix cqlsh DESCRIBE command (CASSANDRA-4913)
 + * save truncation position in system table (CASSANDRA-4906)
 + * Move CompressionMetadata off-heap (CASSANDRA-4937)
 + * allow CLI to GET cql3 columnfamily data (CASSANDRA-4924)
 + * Fix rare race condition in getExpireTimeForEndpoint (CASSANDRA-4402)
 + * acquire references to overlapping sstables during compaction so bloom filter
 +   doesn't get free'd prematurely (CASSANDRA-4934)
 + * Don't share slice query filter in CQL3 SelectStatement (CASSANDRA-4928)
 + * Separate tracing from Log4J (CASSANDRA-4861)
 + * Exclude gcable tombstones from merkle-tree computation (CASSANDRA-4905)
 + * Better printing of AbstractBounds for tracing (CASSANDRA-4931)
 + * Optimize mostRecentTombstone check in CC.collectAllData (CASSANDRA-4883)
 + * Change stream session ID to UUID to avoid collision from same node (CASSANDRA-4813)
 + * Use Stats.db when bulk loading if present (CASSANDRA-4957)
 + * Skip repair on system_trace and keyspaces with RF=1 (CASSANDRA-4956)
 + * (cql3) Remove arbitrary SELECT limit (CASSANDRA-4918)
 + * Correctly handle prepared operation on collections (CASSANDRA-4945)
 + * Fix CQL3 LIMIT (CASSANDRA-4877)
 + * Fix Stress for CQL3 (CASSANDRA-4979)
 + * Remove cassandra specific exceptions from JMX interface (CASSANDRA-4893)
 + * (CQL3) Force using ALLOW FILTERING on potentially inefficient queries (CASSANDRA-4915)
 + * (cql3) Fix adding column when the table has collections (CASSANDRA-4982)
 + * (cql3) Fix allowing collections with compact storage (CASSANDRA-4990)
 + * (cql3) Refuse ttl/writetime function on collections (CASSANDRA-4992)
 + * Replace IAuthority with new IAuthorizer (CASSANDRA-4874)
 + * clqsh: fix KEY pseudocolumn escaping when describing Thrift tables
 +   in CQL3 mode (CASSANDRA-4955)
   * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
   * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)
 +Merged from 1.1:
 + * Fall back to old describe_splits if d_s_ex is not available (CASSANDRA-4803)
 + * Improve error reporting when streaming ranges fail (CASSANDRA-5009)
 + * Fix cqlsh timestamp formatting of timezone info (CASSANDRA-4746)
 + * Fix assertion failure with leveled compaction (CASSANDRA-4799)
 + * Check for null end_token in get_range_slice (CASSANDRA-4804)
 + * Remove all remnants of removed nodes (CASSANDRA-4840)
 + * Add aut-reloading of the log4j file in debian package (CASSANDRA-4855)
 + * Fix estimated row cache entry size (CASSANDRA-4860)
   * reset getRangeSlice filter after finishing a row for get_paged_slice
     (CASSANDRA-4919)
   * expunge row cache post-truncate (CASSANDRA-4940)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f4018ea0/src/java/org/apache/cassandra/cql/CFPropDefs.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql/CFPropDefs.java
index d50f2d0,b7c6a92..ff9ebad
--- a/src/java/org/apache/cassandra/cql/CFPropDefs.java
+++ b/src/java/org/apache/cassandra/cql/CFPropDefs.java
@@@ -7,36 -8,38 +7,35 @@@
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
 - *   http://www.apache.org/licenses/LICENSE-2.0
 - *
 - * Unless required by applicable law or agreed to in writing,
 - * software distributed under the License is distributed on an
 - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - * KIND, either express or implied.  See the License for the
 - * specific language governing permissions and limitations
 - * under the License.
 + *     http://www.apache.org/licenses/LICENSE-2.0
   *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
   */
 -
  package org.apache.cassandra.cql;
  
+ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.Map;
+ import java.util.Set;
+ 
  import com.google.common.collect.Sets;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+ 
  import org.apache.cassandra.config.CFMetaData;
 -import org.apache.cassandra.config.ConfigurationException;
 +import org.apache.cassandra.exceptions.ConfigurationException;
  import org.apache.cassandra.db.compaction.AbstractCompactionStrategy;
  import org.apache.cassandra.db.marshal.AbstractType;
  import org.apache.cassandra.db.marshal.TypeParser;
 -import org.apache.cassandra.io.compress.CompressionParameters;
 -import org.apache.cassandra.thrift.InvalidRequestException;
 +import org.apache.cassandra.exceptions.InvalidRequestException;
 +import org.apache.cassandra.exceptions.SyntaxException;
- import org.apache.cassandra.io.compress.CompressionParameters;
- import org.apache.cassandra.io.compress.SnappyCompressor;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- 
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.Map;
- import java.util.Set;
  
  public class CFPropDefs {
 -    private static Logger logger = LoggerFactory.getLogger(CFPropDefs.class);
 +    private static final Logger logger = LoggerFactory.getLogger(CFPropDefs.class);
  
      public static final String KW_COMPARATOR = "comparator";
      public static final String KW_COMMENT = "comment";

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f4018ea0/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f4018ea0/src/java/org/apache/cassandra/cql3/CFPropDefs.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/CFPropDefs.java
index 0b563cc,721ef72..de613a3
--- a/src/java/org/apache/cassandra/cql3/CFPropDefs.java
+++ b/src/java/org/apache/cassandra/cql3/CFPropDefs.java
@@@ -17,12 -18,12 +17,8 @@@
   */
  package org.apache.cassandra.cql3;
  
- import java.util.Collections;
--import java.util.HashMap;
--import java.util.HashSet;
--import java.util.Map;
--import java.util.Set;
++import java.util.*;
  
 -import com.google.common.collect.Sets;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -93,29 -111,38 +89,23 @@@ public class CFPropDefs extends Propert
          }
      }
  
 -    public void validate() throws ConfigurationException, InvalidRequestException
 +    public Map<String, String> getCompactionOptions() throws SyntaxException
      {
 -        validate(keywords, obsoleteKeywords);
 -
 -        if (properties.containsKey(KW_COMPACTION_STRATEGY_CLASS))
 -        {
 -            compactionStrategyClass = CFMetaData.createCompactionStrategy(properties.get(KW_COMPACTION_STRATEGY_CLASS));
 -            compactionStrategyOptions.remove(KW_COMPACTION_STRATEGY_CLASS);
 -        }
 +        Map<String, String> compactionOptions = getMap(KW_COMPACTION);
 +        if (compactionOptions == null)
 +            return Collections.<String, String>emptyMap();
 +        return compactionOptions;
      }
  
 -    @Override
 -    public void addProperty(String name, String value) throws InvalidRequestException
 +    public Map<String, String> getCompressionOptions() throws SyntaxException
      {
 -        String[] composite = name.split(":");
 -        if (composite.length > 1)
 -        {
 -            if (composite[0].equals(COMPACTION_OPTIONS_PREFIX))
 -            {
 -                compactionStrategyOptions.put(composite[1], value);
 -                return;
 -            }
 -            else if (composite[0].equals(COMPRESSION_PARAMETERS_PREFIX))
 -            {
 -                compressionParameters.put(composite[1], value);
 -                return;
 -            }
 -        }
 -        super.addProperty(name, value);
 +        Map<String, String> compressionOptions = getMap(KW_COMPRESSION);
 +        if (compressionOptions == null)
-         {
-             return new HashMap<String, String>()
-             {{
-                  if (CFMetaData.DEFAULT_COMPRESSOR != null)
-                      put(CompressionParameters.SSTABLE_COMPRESSION, CFMetaData.DEFAULT_COMPRESSOR);
-             }};
-         }
++            return new HashMap<String, String>();
 +        return compressionOptions;
      }
  
 -    public void applyToCFMetadata(CFMetaData cfm) throws ConfigurationException, InvalidRequestException
 +    public void applyToCFMetadata(CFMetaData cfm) throws ConfigurationException, SyntaxException
      {
          if (hasProperty(KW_COMMENT))
              cfm.comment(getString(KW_COMMENT, ""));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f4018ea0/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
index c45c3b1,cffb006..4b96167
--- a/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
@@@ -18,33 -19,31 +18,26 @@@
  package org.apache.cassandra.cql3.statements;
  
  import java.nio.ByteBuffer;
--import java.util.ArrayList;
--import java.util.HashMap;
- import java.util.LinkedHashMap;
--import java.util.List;
--import java.util.Map;
- 
- import org.apache.cassandra.auth.Permission;
++import java.util.*;
  
++import org.apache.cassandra.exceptions.*;
 +import org.apache.commons.lang.StringUtils;
  import com.google.common.collect.HashMultiset;
  import com.google.common.collect.Multiset;
 -import org.apache.commons.lang.StringUtils;
  
+ import org.apache.cassandra.auth.Permission;
++import org.apache.cassandra.config.ColumnDefinition;
++import org.apache.cassandra.config.CFMetaData;
  import org.apache.cassandra.config.Schema;
  import org.apache.cassandra.cql3.*;
--import org.apache.cassandra.config.CFMetaData;
--import org.apache.cassandra.config.ColumnDefinition;
- import org.apache.cassandra.db.marshal.*;
- import org.apache.cassandra.exceptions.ConfigurationException;
- import org.apache.cassandra.exceptions.RequestValidationException;
- import org.apache.cassandra.exceptions.UnauthorizedException;
 -import org.apache.cassandra.config.ConfigurationException;
  import org.apache.cassandra.db.ColumnFamilyType;
- import org.apache.cassandra.exceptions.InvalidRequestException;
 -import org.apache.cassandra.db.marshal.AbstractType;
 -import org.apache.cassandra.db.marshal.CompositeType;
 -import org.apache.cassandra.db.marshal.ReversedType;
 -import org.apache.cassandra.db.marshal.CounterColumnType;
++import org.apache.cassandra.db.marshal.*;
++import org.apache.cassandra.io.compress.CompressionParameters;
  import org.apache.cassandra.service.ClientState;
  import org.apache.cassandra.service.MigrationManager;
  import org.apache.cassandra.thrift.CqlResult;
- import org.apache.cassandra.utils.ByteBufferUtil;
 -import org.apache.cassandra.thrift.InvalidRequestException;
 -import org.apache.cassandra.io.compress.CompressionParameters;
 +import org.apache.cassandra.transport.messages.ResultMessage;
++import org.apache.cassandra.utils.ByteBufferUtil;
  
  /** A <code>CREATE COLUMNFAMILY</code> parsed from a CQL query statement. */
  public class CreateColumnFamilyStatement extends SchemaAlteringStatement
@@@ -64,11 -63,13 +57,25 @@@
      {
          super(name);
          this.properties = properties;
 -        if (CFMetaData.DEFAULT_COMPRESSOR != null && this.properties.compressionParameters.isEmpty())
 -            this.properties.compressionParameters.put(CompressionParameters.SSTABLE_COMPRESSION,
CFMetaData.DEFAULT_COMPRESSOR);
++
++        try
++        {
++            if (!this.properties.hasProperty(CFPropDefs.KW_COMPRESSION) && CFMetaData.DEFAULT_COMPRESSOR
!= null)
++                this.properties.addProperty(CFPropDefs.KW_COMPRESSION,
++                                            new HashMap<String, String>()
++                                            {{
++                                                put(CompressionParameters.SSTABLE_COMPRESSION,
CFMetaData.DEFAULT_COMPRESSOR);
++                                            }});
++        }
++        catch (SyntaxException e)
++        {
++            throw new AssertionError(e);
++        }
      }
  
 -    public void checkAccess(ClientState state) throws InvalidRequestException
 +    public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
      {
 -        state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.WRITE);
 +        state.hasKeyspaceAccess(keyspace(), Permission.CREATE);
      }
  
      // Column definitions


Mime
View raw message