cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: Revert "presize collections"
Date Mon, 18 Jul 2016 09:15:44 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 0a5603789 -> 299ab74f4


Revert "presize collections"

Issue CASSANDRA-12220 was found, because of this change

This reverts commit 70fd80ae43f3902e651c956b6d4d07cbc203d30a.


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

Branch: refs/heads/trunk
Commit: 299ab74f4ae78319c9ca67ccd8251656078b798c
Parents: 0a56037
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Mon Jul 18 05:14:22 2016 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Mon Jul 18 05:14:22 2016 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/CFMetaData.java            | 5 ++---
 .../org/apache/cassandra/cql3/statements/BatchStatement.java    | 3 +--
 .../apache/cassandra/cql3/statements/CreateIndexStatement.java  | 3 +--
 .../apache/cassandra/cql3/statements/CreateViewStatement.java   | 3 +--
 .../org/apache/cassandra/db/compaction/CompactionManager.java   | 2 +-
 5 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/299ab74f/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 b175ef1c..4de4f7b 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -32,7 +32,6 @@ import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
@@ -305,7 +304,7 @@ public final class CFMetaData
     {
         this.comparator = new ClusteringComparator(extractTypes(clusteringColumns));
 
-        Map<ByteBuffer, ColumnDefinition> newColumnMetadata = Maps.newHashMapWithExpectedSize(partitionKeyColumns.size()
+ clusteringColumns.size() + partitionColumns.size());
+        Map<ByteBuffer, ColumnDefinition> newColumnMetadata = new HashMap<>();
         for (ColumnDefinition def : partitionKeyColumns)
             newColumnMetadata.put(def.name.bytes, def);
         for (ColumnDefinition def : clusteringColumns)
@@ -1261,7 +1260,7 @@ public final class CFMetaData
 
         public Set<String> usedColumnNames()
         {
-            Set<String> usedNames = Sets.newHashSetWithExpectedSize(partitionKeys.size()
+ clusteringColumns.size() + staticColumns.size() + regularColumns.size());
+            Set<String> usedNames = new HashSet<>();
             for (Pair<ColumnIdentifier, AbstractType> p : partitionKeys)
                 usedNames.add(p.left.toString());
             for (Pair<ColumnIdentifier, AbstractType> p : clusteringColumns)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/299ab74f/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index 14638e2..2739c2e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@ -22,7 +22,6 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.helpers.MessageFormatter;
@@ -555,7 +554,7 @@ public class BatchStatement implements CQLStatement
 
         public Map<UUID, PartitionColumns> build()
         {
-            Map<UUID, PartitionColumns> m = Maps.newHashMapWithExpectedSize(perTableBuilders.size());
+            Map<UUID, PartitionColumns> m = new HashMap<>();
             for (Map.Entry<UUID, PartitionColumns.Builder> p : perTableBuilders.entrySet())
                 m.put(p.getKey(), p.getValue().build());
             return m;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/299ab74f/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java
index 2526f79..f899247 100644
--- a/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CreateIndexStatement.java
@@ -22,7 +22,6 @@ import java.util.*;
 import com.google.common.base.Optional;
 import com.google.common.base.Strings;
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -174,7 +173,7 @@ public class CreateIndexStatement extends SchemaAlteringStatement
         if (!properties.isCustom)
             throw new InvalidRequestException("Only CUSTOM indexes support multiple columns");
 
-        Set<ColumnIdentifier> columns = Sets.newHashSetWithExpectedSize(targets.size());
+        Set<ColumnIdentifier> columns = new HashSet<>();
         for (IndexTarget target : targets)
             if (!columns.add(target.column))
                 throw new InvalidRequestException("Duplicate column " + target.column + "
in index target list");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/299ab74f/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java
index 5e14e72..2bae73e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CreateViewStatement.java
@@ -22,7 +22,6 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
 
 import org.apache.cassandra.auth.Permission;
 import org.apache.cassandra.config.CFMetaData;
@@ -149,7 +148,7 @@ public class CreateViewStatement extends SchemaAlteringStatement
                                                             baseName.getColumnFamily()));
         }
 
-        Set<ColumnIdentifier> included = Sets.newHashSetWithExpectedSize(selectClause.size());
+        Set<ColumnIdentifier> included = new HashSet<>();
         for (RawSelector selector : selectClause)
         {
             Selectable.Raw selectable = selector.selectable;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/299ab74f/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 519ff05..a653b58 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -1279,7 +1279,7 @@ public class CompactionManager implements CompactionManagerMBean
     {
         MerkleTrees tree = new MerkleTrees(cfs.getPartitioner());
         long allPartitions = 0;
-        Map<Range<Token>, Long> rangePartitionCounts = Maps.newHashMapWithExpectedSize(ranges.size());
+        Map<Range<Token>, Long> rangePartitionCounts = new HashMap<>();
         for (Range<Token> range : ranges)
         {
             long numPartitions = 0;


Mime
View raw message