cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject git commit: Add missing table name to DROP INDEX responses
Date Tue, 15 Jul 2014 17:25:28 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 1c4768a88 -> ae25812e3


Add missing table name to DROP INDEX responses

Patch and review by Tyler Hobbs and Aleksey Yeschenko for CASSANDRA-7539


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

Branch: refs/heads/trunk
Commit: ae25812e39cb29c6ad0d0625eec9268e55c2fb38
Parents: 1c4768a
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Tue Jul 15 12:23:06 2014 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Tue Jul 15 12:25:05 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../cassandra/cql3/statements/DropIndexStatement.java    | 11 +++++++++++
 src/java/org/apache/cassandra/transport/Event.java       |  2 ++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae25812e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 27aa624..8895bf4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -28,6 +28,7 @@
 2.1.0-final
  * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
  * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
+ * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)
 Merged from 2.0:
  * (Windows) force range-based repair to non-sequential mode (CASSANDRA-7541)
  * Fix range merging when DES scores are zero (CASSANDRA-7535)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae25812e/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
index b8a4c9a..0562cc6 100644
--- a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
@@ -33,6 +33,9 @@ public class DropIndexStatement extends SchemaAlteringStatement
     public final String indexName;
     public final boolean ifExists;
 
+    // initialized in announceMigration()
+    private String indexedCF;
+
     public DropIndexStatement(IndexName indexName, boolean ifExists)
     {
         super(indexName.getCfName());
@@ -67,6 +70,7 @@ public class DropIndexStatement extends SchemaAlteringStatement
             return;
 
         CFMetaData updatedCfm = updateCFMetadata(cfm);
+        indexedCF = updatedCfm.cfName;
         MigrationManager.announceColumnFamilyUpdate(updatedCfm, false, isLocalOnly);
     }
 
@@ -106,4 +110,11 @@ public class DropIndexStatement extends SchemaAlteringStatement
         }
         return null;
     }
+
+    @Override
+    public String columnFamily()
+    {
+        assert indexedCF != null;
+        return indexedCF;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae25812e/src/java/org/apache/cassandra/transport/Event.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/Event.java b/src/java/org/apache/cassandra/transport/Event.java
index 3fa2733..1b7e487 100644
--- a/src/java/org/apache/cassandra/transport/Event.java
+++ b/src/java/org/apache/cassandra/transport/Event.java
@@ -218,6 +218,8 @@ public abstract class Event
             this.target = target;
             this.keyspace = keyspace;
             this.tableOrType = tableOrType;
+            if (target != Target.KEYSPACE)
+                assert this.tableOrType != null : "Table or type should be set for non-keyspace
schema change events";
         }
 
         public SchemaChange(Change change, String keyspace)


Mime
View raw message