You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2015/06/03 12:56:15 UTC

cassandra git commit: Add broadcast and rpc addresses to system.local

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 9b10928c1 -> b6a31fb5b


Add broadcast and rpc addresses to system.local

patch by Carl Yeksigian; reviewed by Aleksey Yeschenko for
CASSANDRA-9436


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

Branch: refs/heads/cassandra-2.0
Commit: b6a31fb5b9f955a159752a09014a13c776fe3e1f
Parents: 9b10928
Author: Carl Yeksigian <ca...@apache.org>
Authored: Fri May 29 13:28:40 2015 -0400
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Jun 3 13:54:59 2015 +0300

----------------------------------------------------------------------
 CHANGES.txt                                      |   1 +
 .../org/apache/cassandra/config/CFMetaData.java  |   4 +++-
 .../org/apache/cassandra/db/SystemKeyspace.java  |   6 ++++--
 test/data/serialization/2.0/db.RowMutation.bin   | Bin 3599 -> 3599 bytes
 4 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6a31fb5/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1aad965..c555a91 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.16:
+ * Add broadcast and rpc addresses to system.local (CASSANDRA-9436)
  * Always mark sstable suspect when corrupted (CASSANDRA-9478)
  * Add database users and permissions to CQL3 documentation (CASSANDRA-7558)
  * Allow JVM_OPTS to be passed to standalone tools (CASSANDRA-5969)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6a31fb5/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 056b305..9d0450b 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -207,7 +207,9 @@ public final class CFMetaData
                                                      + "rack text,"
                                                      + "partitioner text,"
                                                      + "schema_version uuid,"
-                                                     + "truncated_at map<uuid, blob>"
+                                                     + "truncated_at map<uuid, blob>,"
+                                                     + "rpc_address inet,"
+                                                     + "broadcast_address inet"
                                                      + ") WITH COMMENT='information about the local node'");
 
     public static final CFMetaData TraceSessionsCf = compile("CREATE TABLE " + Tracing.SESSIONS_CF + " ("

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6a31fb5/src/java/org/apache/cassandra/db/SystemKeyspace.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SystemKeyspace.java b/src/java/org/apache/cassandra/db/SystemKeyspace.java
index 5b28ea6..e439de7 100644
--- a/src/java/org/apache/cassandra/db/SystemKeyspace.java
+++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java
@@ -152,7 +152,7 @@ public class SystemKeyspace
 
     private static void setupVersion()
     {
-        String req = "INSERT INTO system.%s (key, release_version, cql_version, thrift_version, native_protocol_version, data_center, rack, partitioner) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')";
+        String req = "INSERT INTO system.%s (key, release_version, cql_version, thrift_version, native_protocol_version, data_center, rack, partitioner, rpc_address, broadcast_address) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')";
         IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch();
         processInternal(String.format(req, LOCAL_CF,
                                          LOCAL_KEY,
@@ -162,7 +162,9 @@ public class SystemKeyspace
                                          Server.CURRENT_VERSION,
                                          snitch.getDatacenter(FBUtilities.getBroadcastAddress()),
                                          snitch.getRack(FBUtilities.getBroadcastAddress()),
-                                         DatabaseDescriptor.getPartitioner().getClass().getName()));
+                                         DatabaseDescriptor.getPartitioner().getClass().getName(),
+                                         DatabaseDescriptor.getRpcAddress().getHostAddress(),
+                                         FBUtilities.getBroadcastAddress().getHostAddress()));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6a31fb5/test/data/serialization/2.0/db.RowMutation.bin
----------------------------------------------------------------------
diff --git a/test/data/serialization/2.0/db.RowMutation.bin b/test/data/serialization/2.0/db.RowMutation.bin
index 73d93e8..664a5b4 100644
Binary files a/test/data/serialization/2.0/db.RowMutation.bin and b/test/data/serialization/2.0/db.RowMutation.bin differ