cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject cassandra git commit: Follow up 12443
Date Fri, 20 Jan 2017 14:54:29 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 7a06df79d -> f3b452c54


Follow up 12443


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

Branch: refs/heads/cassandra-3.0
Commit: f3b452c54dea0366436ebe2bceac747bdf599e90
Parents: 7a06df7
Author: Benjamin Lerer <b.lerer@gmail.com>
Authored: Fri Jan 20 15:53:34 2017 +0100
Committer: Benjamin Lerer <b.lerer@gmail.com>
Committed: Fri Jan 20 15:53:34 2017 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/CFMetaData.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3b452c5/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 a3370dc..44f3a96 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -84,9 +84,9 @@ public final class CFMetaData
     private final boolean isView;
     private final boolean isIndex;
 
-    public final ClusteringComparator comparator;  // bytes, long, timeuuid, utf8, etc. This
is built directly from clusteringColumns
+    public volatile ClusteringComparator comparator;  // bytes, long, timeuuid, utf8, etc.
This is built directly from clusteringColumns
     public final IPartitioner partitioner;            // partitioner the table uses
-    private final AbstractType<?> keyValidator;
+    private volatile AbstractType<?> keyValidator;
 
     private final Serializers serializers;
 
@@ -285,10 +285,6 @@ public final class CFMetaData
 
         this.serializers = new Serializers(this);
 
-        this.comparator = new ClusteringComparator(extractTypes(clusteringColumns));
-        List<AbstractType<?>> keyTypes = extractTypes(partitionKeyColumns);
-        this.keyValidator = keyTypes.size() == 1 ? keyTypes.get(0) : CompositeType.getInstance(keyTypes);
-
         rebuild();
     }
 
@@ -296,6 +292,8 @@ public final class CFMetaData
     // are kept because they are often useful in a different format.
     private void rebuild()
     {
+        this.comparator = new ClusteringComparator(extractTypes(clusteringColumns));
+
         Map<ByteBuffer, ColumnDefinition> newColumnMetadata = new HashMap<>();
         for (ColumnDefinition def : partitionKeyColumns)
             newColumnMetadata.put(def.name.bytes, def);
@@ -306,6 +304,9 @@ public final class CFMetaData
 
         this.columnMetadata = newColumnMetadata;
 
+        List<AbstractType<?>> keyTypes = extractTypes(partitionKeyColumns);
+        this.keyValidator = keyTypes.size() == 1 ? keyTypes.get(0) : CompositeType.getInstance(keyTypes);
+
         if (isCompactTable())
             this.compactValueColumn = CompactTables.getCompactValueColumn(partitionColumns,
isSuper());
     }


Mime
View raw message