Permalink
Browse files

Print the nodes in sorted order

  • Loading branch information...
1 parent 23371cd commit b82402ef35037bc3e487301d939411303390d77e Joshua Hartman committed Sep 15, 2011
@@ -46,8 +46,9 @@ object NorbertClusterClientMain {
command match {
case "nodes" =>
val ts = System.currentTimeMillis
- val nodes = cluster.nodes
- if (nodes.size > 0) println(nodes.mkString("\n")) else println("The cluster has no nodes")
+ val nodes = cluster.nodes.toArray
+ val sortedNodes = nodes.sortWith((node1, node2) => node1.id < node2.id)
+ if (nodes.size > 0) println(sortedNodes.mkString("\n")) else println("The cluster has no nodes")
case "join" =>
args match {

0 comments on commit b82402e

Please sign in to comment.