cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [2/2] git commit: Fix #4037 commit
Date Thu, 22 Mar 2012 15:55:10 GMT
Fix #4037 commit


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

Branch: refs/heads/trunk
Commit: 11bdcd6d7f78709fdf069fbd03ffe1418c76980f
Parents: df10325
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Thu Mar 22 16:53:40 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Thu Mar 22 16:53:40 2012 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/config/CFMetaData.java    |   11 ++++++++++-
 .../apache/cassandra/config/ColumnDefinition.java  |    5 +++++
 2 files changed, 15 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/11bdcd6d/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index 22b16d7..b3e3a8b 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -353,6 +353,12 @@ public final class CFMetaData
 
     static CFMetaData copyOpts(CFMetaData newCFMD, CFMetaData oldCFMD)
     {
+        Map<ByteBuffer, ColumnDefinition> clonedColumns = new HashMap<ByteBuffer,
ColumnDefinition>();
+        for (ColumnDefinition cd : oldCFMD.column_metadata.values())
+        {
+            ColumnDefinition cloned = cd.clone();
+            clonedColumns.put(cloned.name, cloned);
+        }
         return newCFMD.comment(oldCFMD.comment)
                       .readRepairChance(oldCFMD.readRepairChance)
                       .dcLocalReadRepairChance(oldCFMD.dcLocalReadRepairChance)
@@ -362,7 +368,10 @@ public final class CFMetaData
                       .keyValidator(oldCFMD.keyValidator)
                       .minCompactionThreshold(oldCFMD.minCompactionThreshold)
                       .maxCompactionThreshold(oldCFMD.maxCompactionThreshold)
-                      .columnMetadata(oldCFMD.column_metadata)
+                      .keyAlias(oldCFMD.keyAlias)
+                      .columnAliases(new ArrayList<ByteBuffer>(oldCFMD.columnAliases))
+                      .valueAlias(oldCFMD.valueAlias)
+                      .columnMetadata(clonedColumns)
                       .compactionStrategyClass(oldCFMD.compactionStrategyClass)
                       .compactionStrategyOptions(oldCFMD.compactionStrategyOptions)
                       .compressionParameters(oldCFMD.compressionParameters)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/11bdcd6d/src/java/org/apache/cassandra/config/ColumnDefinition.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/ColumnDefinition.java b/src/java/org/apache/cassandra/config/ColumnDefinition.java
index f6d8209..795f1d2 100644
--- a/src/java/org/apache/cassandra/config/ColumnDefinition.java
+++ b/src/java/org/apache/cassandra/config/ColumnDefinition.java
@@ -83,6 +83,11 @@ public class ColumnDefinition
         return new ColumnDefinition(ByteBufferUtil.bytes(name), DoubleType.instance, null,
null, null);
     }
 
+    public ColumnDefinition clone()
+    {
+        return new ColumnDefinition(name, validator, index_type, index_options, index_name);
+    }
+
     @Override
     public boolean equals(Object o)
     {


Mime
View raw message