cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: node map does not handle InetAddressAndPort correctly.
Date Wed, 07 Feb 2018 16:48:10 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 5c3e33b17 -> d0b34d383


node map does not handle InetAddressAndPort correctly.

patch by dbrosius, reviewed by aweisberg for CASSANDRA-14216


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

Branch: refs/heads/trunk
Commit: d0b34d383c20f5add8b8d7d454b4460aace0c939
Parents: 5c3e33b
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Wed Feb 7 11:46:47 2018 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Wed Feb 7 11:46:47 2018 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/service/StorageService.java    | 8 ++++----
 .../apache/cassandra/tools/nodetool/SetHostStatWithPort.java | 2 +-
 src/java/org/apache/cassandra/tools/nodetool/Status.java     | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d0b34d38/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 cda575a..16b6a81 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -4766,8 +4766,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
         {
             InetAddressAndPort endpoint = tokenMetadata.getEndpoint(entry.getKey());
             Float tokenOwnership = entry.getValue();
-            if (nodeMap.containsKey(endpoint))
-                nodeMap.put(endpoint.address, nodeMap.get(endpoint) + tokenOwnership);
+            if (nodeMap.containsKey(endpoint.address))
+                nodeMap.put(endpoint.address, nodeMap.get(endpoint.address) + tokenOwnership);
             else
                 nodeMap.put(endpoint.address, tokenOwnership);
         }
@@ -4784,8 +4784,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
         {
             InetAddressAndPort endpoint = tokenMetadata.getEndpoint(entry.getKey());
             Float tokenOwnership = entry.getValue();
-            if (nodeMap.containsKey(endpoint))
-                nodeMap.put(endpoint.toString(), nodeMap.get(endpoint) + tokenOwnership);
+            if (nodeMap.containsKey(endpoint.toString()))
+                nodeMap.put(endpoint.toString(), nodeMap.get(endpoint.toString()) + tokenOwnership);
             else
                 nodeMap.put(endpoint.toString(), tokenOwnership);
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d0b34d38/src/java/org/apache/cassandra/tools/nodetool/SetHostStatWithPort.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetHostStatWithPort.java b/src/java/org/apache/cassandra/tools/nodetool/SetHostStatWithPort.java
index 67cd464..6ac0258 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetHostStatWithPort.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetHostStatWithPort.java
@@ -50,7 +50,7 @@ public class SetHostStatWithPort implements Iterable<HostStatWithPort>
     public void add(String token, String host, Map<String, Float> ownerships) throws
UnknownHostException
     {
         InetAddressAndPort endpoint = InetAddressAndPort.getByName(host);
-        Float owns = ownerships.get(endpoint);
+        Float owns = ownerships.get(endpoint.toString());
         hostStats.add(new HostStatWithPort(token, endpoint, resolveIp, owns));
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d0b34d38/src/java/org/apache/cassandra/tools/nodetool/Status.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/nodetool/Status.java b/src/java/org/apache/cassandra/tools/nodetool/Status.java
index 49724a5..10c7fdf 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/Status.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/Status.java
@@ -116,7 +116,7 @@ public class Status extends NodeToolCmd
 
                 for (InetAddressAndPort endpoint : hostToTokens.keySet())
                 {
-                    Float owns = ownerships.get(endpoint);
+                    Float owns = ownerships.get(endpoint.toString());
                     List<HostStatWithPort> tokens = hostToTokens.get(endpoint);
                     printNodeWithPort(endpoint.toString(), owns, tokens, hasEffectiveOwns,
isTokenPerNode);
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message