Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 97D851102F for ; Mon, 5 May 2014 07:28:09 +0000 (UTC) Received: (qmail 36794 invoked by uid 500); 5 May 2014 07:28:07 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 36522 invoked by uid 500); 5 May 2014 07:28:07 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 36497 invoked by uid 99); 5 May 2014 07:28:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 07:28:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A211890D853; Mon, 5 May 2014 07:28:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: slebresne@apache.org To: commits@cassandra.apache.org Date: Mon, 05 May 2014 07:28:04 -0000 Message-Id: <8faaf3805fb44cbf8ff40b1dc250b356@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/3] git commit: Fix ClassCastException on composite dense tables Fix ClassCastException on composite dense tables patch by slebresne; reviewed by thobbs for CASSANDRA-7112 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3aa41fbc Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3aa41fbc Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3aa41fbc Branch: refs/heads/cassandra-2.1 Commit: 3aa41fbce807d07e3952cbc78beec7cbc2d743e7 Parents: 7e8efd1 Author: Sylvain Lebresne Authored: Mon May 5 09:23:27 2014 +0200 Committer: Sylvain Lebresne Committed: Mon May 5 09:23:27 2014 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/db/composites/CompoundDenseCellNameType.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3aa41fbc/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index ddcb09c..2f55eee 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,7 @@ 2.1.0-rc1 * Parallel streaming for sstableloader (CASSANDRA-3668) * Fix bugs in supercolumns handling (CASSANDRA-7138) + * Fix ClassClassException on composite dense tables (CASSANDRA-7112) Merged from 2.0: * Make batchlog replica selection rack-aware (CASSANDRA-6551) * Suggest CTRL-C or semicolon after three blank lines in cqlsh (CASSANDRA-7142) http://git-wip-us.apache.org/repos/asf/cassandra/blob/3aa41fbc/src/java/org/apache/cassandra/db/composites/CompoundDenseCellNameType.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/composites/CompoundDenseCellNameType.java b/src/java/org/apache/cassandra/db/composites/CompoundDenseCellNameType.java index 0fd2f4b..e3c2831 100644 --- a/src/java/org/apache/cassandra/db/composites/CompoundDenseCellNameType.java +++ b/src/java/org/apache/cassandra/db/composites/CompoundDenseCellNameType.java @@ -67,10 +67,10 @@ public class CompoundDenseCellNameType extends AbstractCompoundCellNameType protected Composite makeWith(ByteBuffer[] components, int size, Composite.EOC eoc, boolean isStatic) { assert !isStatic; - if (size < fullSize || eoc != Composite.EOC.NONE) - return new CompoundComposite(components, size, false).withEOC(eoc); - - return new CompoundDenseCellName(components, size); + // A composite dense table cell name don't have to have all the component set to qualify as a + // proper CellName (for backward compatibility reasons mostly), so always return a cellName + Composite c = new CompoundDenseCellName(components, size); + return eoc != Composite.EOC.NONE ? c.withEOC(eoc) : c; } protected Composite copyAndMakeWith(ByteBuffer[] components, int size, Composite.EOC eoc, boolean isStatic)