Skip to content

Commit

Permalink
Print the nodes in sorted order
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hartman committed Sep 15, 2011
1 parent 23371cd commit b82402e
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -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 {
Expand Down

0 comments on commit b82402e

Please sign in to comment.