cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r811482 - /incubator/cassandra/branches/cassandra-0.4/src/java/org/apache/cassandra/tools/NodeProbe.java
Date Fri, 04 Sep 2009 16:41:53 GMT
Author: eevans
Date: Fri Sep  4 16:41:53 2009
New Revision: 811482

URL: http://svn.apache.org/viewvc?rev=811482&view=rev
Log:
properly order ranges in nodeprobe output

Patch by eevans; review by jbellis for CASSANDRA-421

Modified:
    incubator/cassandra/branches/cassandra-0.4/src/java/org/apache/cassandra/tools/NodeProbe.java

Modified: incubator/cassandra/branches/cassandra-0.4/src/java/org/apache/cassandra/tools/NodeProbe.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/branches/cassandra-0.4/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=811482&r1=811481&r2=811482&view=diff
==============================================================================
--- incubator/cassandra/branches/cassandra-0.4/src/java/org/apache/cassandra/tools/NodeProbe.java
(original)
+++ incubator/cassandra/branches/cassandra-0.4/src/java/org/apache/cassandra/tools/NodeProbe.java
Fri Sep  4 16:41:53 2009
@@ -26,6 +26,7 @@
 import java.lang.management.RuntimeMXBean;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -275,6 +276,8 @@
     public void printRing(PrintStream outs)
     {
         Map<Range, List<EndPoint>> rangeMap = getRangeToEndpointMap();
+        List<Range> ranges = new ArrayList<Range>(rangeMap.keySet());
+        Collections.sort(ranges);
         
         // Print range-to-endpoint mapping
         int counter = 0;
@@ -283,7 +286,7 @@
         outs.print(String.format("%-4s ", "Size"));
         outs.print(String.format("%-15s", "Address"));
         outs.println("Ring");
-        for (Range range : rangeMap.keySet()) {
+        for (Range range : ranges) {
             List<EndPoint> endpoints = rangeMap.get(range);
             
             outs.print(String.format("%-46s ", range.left()));



Mime
View raw message