cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [6/6] cassandra git commit: Merge branch 'cassandra-3.1' into trunk
Date Fri, 13 Nov 2015 18:00:05 GMT
Merge branch 'cassandra-3.1' into trunk


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

Branch: refs/heads/trunk
Commit: d8ad0f0f2a1ba459bfcd07aee972285bc4fd5cc1
Parents: 3482230 00c31a2
Author: Sam Tunnicliffe <sam@beobal.com>
Authored: Fri Nov 13 17:53:11 2015 +0000
Committer: Sam Tunnicliffe <sam@beobal.com>
Committed: Fri Nov 13 17:56:32 2015 +0000

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/index/SecondaryIndexManager.java  |  7 ++++-
 .../apache/cassandra/index/CustomIndexTest.java | 33 ++++++++++++++++++++
 3 files changed, 40 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d8ad0f0f/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 0af24a7,6aff321..6ee2beb
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,11 -1,6 +1,12 @@@
 +3.2
 + * Added graphing option to cassandra-stress (CASSANDRA-7918)
 + * Abort in-progress queries that time out (CASSANDRA-7392)
 + * Add transparent data encryption core classes (CASSANDRA-9945)
 +
 +
  3.1
  Merged from 3.0:
+  * Notify indexers of partition delete during cleanup (CASSANDRA-10685)
   * Keep the file open in trySkipCache (CASSANDRA-10669)
   * Updated trigger example (CASSANDRA-10257)
  Merged from 2.2:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d8ad0f0f/test/unit/org/apache/cassandra/index/CustomIndexTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/index/CustomIndexTest.java
index b372c59,b305868..ad68613
--- a/test/unit/org/apache/cassandra/index/CustomIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/CustomIndexTest.java
@@@ -18,6 -19,7 +19,7 @@@ import org.apache.cassandra.cql3.statem
  import org.apache.cassandra.cql3.statements.SelectStatement;
  import org.apache.cassandra.db.ColumnFamilyStore;
  import org.apache.cassandra.db.ReadCommand;
 -import org.apache.cassandra.db.ReadOrderGroup;
++import org.apache.cassandra.db.ReadExecutionController;
  import org.apache.cassandra.db.marshal.AbstractType;
  import org.apache.cassandra.db.marshal.Int32Type;
  import org.apache.cassandra.db.marshal.UTF8Type;
@@@ -471,6 -475,35 +475,35 @@@ public class CustomIndexTest extends CQ
          assertEquals(1, index.reloads.get());
      }
  
+     @Test
+     public void notifyIndexersOfPartitionAndRowRemovalDuringCleanup() throws Throwable
+     {
+         createTable("CREATE TABLE %s (k int, c int, v int, PRIMARY KEY (k,c))");
+         createIndex(String.format("CREATE CUSTOM INDEX cleanup_index ON %%s() USING '%s'",
StubIndex.class.getName()));
+         ColumnFamilyStore cfs = getCurrentColumnFamilyStore();
+         StubIndex index  = (StubIndex)cfs.indexManager.getIndexByName("cleanup_index");
+ 
+         execute("INSERT INTO %s (k, c, v) VALUES (?, ?, ?)", 0, 0, 0);
+         execute("INSERT INTO %s (k, c, v) VALUES (?, ?, ?)", 0, 1, 1);
+         execute("INSERT INTO %s (k, c, v) VALUES (?, ?, ?)", 0, 2, 2);
+         execute("INSERT INTO %s (k, c, v) VALUES (?, ?, ?)", 3, 3, 3);
+         assertEquals(4, index.rowsInserted.size());
+         assertEquals(0, index.partitionDeletions.size());
+ 
+         ReadCommand cmd = Util.cmd(cfs, 0).build();
 -        try (ReadOrderGroup orderGroup = cmd.startOrderGroup();
 -             UnfilteredPartitionIterator iterator = cmd.executeLocally(orderGroup))
++        try (ReadExecutionController executionController = cmd.executionController();
++             UnfilteredPartitionIterator iterator = cmd.executeLocally(executionController))
+         {
+             assertTrue(iterator.hasNext());
+             cfs.indexManager.deletePartition(iterator.next(), FBUtilities.nowInSeconds());
+         }
+ 
+         assertEquals(1, index.partitionDeletions.size());
+         assertEquals(3, index.rowsDeleted.size());
+         for (int i = 0; i < 3; i++)
+             assertEquals(index.rowsDeleted.get(i).clustering(), index.rowsInserted.get(i).clustering());
+     }
+ 
      private void testCreateIndex(String indexName, String... targetColumnNames) throws Throwable
      {
          createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(%s) USING '%s'",


Mime
View raw message