cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [1/8] git commit: getValidColumnFamilies adds 2I if requested and no ks/cf specified Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-6598
Date Thu, 16 Jan 2014 22:52:38 GMT
Updated Branches:
  refs/heads/cassandra-1.2 b168f3e29 -> 18789da7c
  refs/heads/cassandra-2.0 120437e15 -> ee7938391
  refs/heads/trunk 8a078054e -> dd49497e9


getValidColumnFamilies adds 2I if requested and no ks/cf specified
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-6598


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

Branch: refs/heads/cassandra-2.0
Commit: b168f3e294e7db6abfbfda777a567acd76bfa863
Parents: 5f63578
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Thu Jan 16 15:04:26 2014 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Thu Jan 16 15:04:26 2014 -0600

----------------------------------------------------------------------
 .../apache/cassandra/service/StorageService.java | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b168f3e2/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 7c8a257..90089ab 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2276,13 +2276,28 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
     public Iterable<ColumnFamilyStore> getValidColumnFamilies(boolean allowIndexes,
boolean autoAddIndexes, String tableName, String... cfNames) throws IOException
     {
         Table table = getValidTable(tableName);
+        Set<ColumnFamilyStore> valid = new HashSet<ColumnFamilyStore>();
 
         if (cfNames.length == 0)
+        {
             // all stores are interesting
-            return table.getColumnFamilyStores();
+            for (ColumnFamilyStore cfStore : table.getColumnFamilyStores())
+            {
+                valid.add(cfStore);
+                if (autoAddIndexes)
+                {
+                    for (SecondaryIndex si : cfStore.indexManager.getIndexes())
+                    {
+                        logger.info("adding secondary index {} to operation", si.getIndexName());
+                        valid.add(si.getIndexCfs());
+                    }
+
+                }
 
+            }
+            return valid;
+        }
         // filter out interesting stores
-        Set<ColumnFamilyStore> valid = new HashSet<ColumnFamilyStore>();
         for (String cfName : cfNames)
         {
             //if the CF name is an index, just flush the CF that owns the index


Mime
View raw message