cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject cassandra git commit: consistently sort DCs in nodetool:status
Date Fri, 28 Aug 2015 14:02:13 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 7e1ea4c8c -> 264cf3647


consistently sort DCs in nodetool:status

patch by Chris Burroughs; reviewed by Paulo Motta for CASSANDRA-10131


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

Branch: refs/heads/cassandra-2.1
Commit: 264cf3647b33109e44babc0aa397ee7b492265ed
Parents: 7e1ea4c
Author: Chris Burroughs <chris.burroughs@gmail.com>
Authored: Fri Aug 28 16:01:10 2015 +0200
Committer: blerer <benjamin.lerer@datastax.com>
Committed: Fri Aug 28 16:01:10 2015 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/tools/NodeTool.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/264cf364/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java
index 6a7a930..8e88f45 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -66,6 +66,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Scanner;
 import java.util.Set;
+import java.util.SortedMap;
 import java.util.concurrent.ExecutionException;
 
 import javax.management.InstanceNotFoundException;
@@ -2156,7 +2157,7 @@ public class NodeTool
                 System.exit(1);
             }
 
-            Map<String, SetHostStat> dcs = getOwnershipByDc(probe, resolveIp, tokensToEndpoints,
ownerships);
+            SortedMap<String, SetHostStat> dcs = getOwnershipByDc(probe, resolveIp,
tokensToEndpoints, ownerships);
 
             // More tokens than nodes (aka vnodes)?
             if (dcs.values().size() < tokensToEndpoints.keySet().size())
@@ -2277,11 +2278,11 @@ public class NodeTool
         }
     }
 
-    private static Map<String, SetHostStat> getOwnershipByDc(NodeProbe probe, boolean
resolveIp, 
-                                                             Map<String, String> tokenToEndpoint,
-                                                             Map<InetAddress, Float>
ownerships)
+    private static SortedMap<String, SetHostStat> getOwnershipByDc(NodeProbe probe,
boolean resolveIp,
+                                                                   Map<String, String>
tokenToEndpoint,
+                                                                   Map<InetAddress, Float>
ownerships)
     {
-        Map<String, SetHostStat> ownershipByDc = Maps.newLinkedHashMap();
+        SortedMap<String, SetHostStat> ownershipByDc = Maps.newTreeMap();
         EndpointSnitchInfoMBean epSnitchInfo = probe.getEndpointSnitchInfoProxy();
         try
         {


Mime
View raw message