cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Return empty schema to pre-1.2 nodes' migration requests
Date Thu, 14 Mar 2013 00:09:42 GMT
Updated Branches:
  refs/heads/cassandra-1.2 bb6323874 -> 8eca4ad01


Return empty schema to pre-1.2 nodes' migration requests


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

Branch: refs/heads/cassandra-1.2
Commit: 8eca4ad01a595c747ca6012f202ae836b76723c3
Parents: bb63238
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Thu Mar 14 03:08:42 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu Mar 14 03:08:42 2013 +0300

----------------------------------------------------------------------
 .../cassandra/db/MigrationRequestVerbHandler.java  |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8eca4ad0/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java b/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
index 97fd641..1992c01 100644
--- a/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
+++ b/src/java/org/apache/cassandra/db/MigrationRequestVerbHandler.java
@@ -18,6 +18,7 @@
 package org.apache.cassandra.db;
 
 import java.util.Collection;
+import java.util.Collections;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,8 +40,16 @@ public class MigrationRequestVerbHandler implements IVerbHandler
     public void doVerb(MessageIn message, String id)
     {
         logger.debug("Received migration request from {}.", message.from);
+
+        if (message.version < MessagingService.VERSION_12)
+            logger.debug("Returning empty response to the migration request from {} (version
< 1.2).", message.from);
+
+        Collection<RowMutation> schema = message.version < MessagingService.VERSION_12
+                                         ? Collections.EMPTY_SET
+                                         : SystemTable.serializeSchema();
+
         MessageOut<Collection<RowMutation>> response = new MessageOut<Collection<RowMutation>>(MessagingService.Verb.INTERNAL_RESPONSE,
-                                                                                        
      SystemTable.serializeSchema(),
+                                                                                        
      schema,
                                                                                         
      MigrationManager.MigrationsSerializer.instance);
         MessagingService.instance().sendReply(response, id, message.from);
     }


Mime
View raw message