Merge branch 'cassandra-2.0' into cassandra-2.1

This commit is contained in:
Mikhail Stepura 2014-05-15 19:27:32 -07:00
commit b9c9039a19
2 changed files with 6 additions and 2 deletions

View File

@ -32,6 +32,7 @@ Merged from 2.0:
* cqlsh: Accept and execute CQL statement(s) from command-line parameter (CASSANDRA-7172)
* Fix IllegalStateException in CqlPagingRecordReader (CASSANDRA-7198)
* Fix the InvertedIndex trigger example (CASSANDRA-7211)
* Add --resolve-ip option to 'nodetool ring' (CASSANDRA-7210)
Merged from 1.2:
* Add Cloudstack snitch (CASSANDRA-7147)
* Update system.peers correctly when relocating tokens (CASSANDRA-7126)

View File

@ -424,6 +424,9 @@ public class NodeTool
@Arguments(description = "Specify a keyspace for accurate ownership information (topology awareness)")
private String keyspace = null;
@Option(title = "resolve_ip", name = {"-r", "--resolve-ip"}, description = "Show node domain names instead of IPs")
private boolean resolveIp = false;
@Override
public void execute(NodeProbe probe)
{
@ -455,7 +458,7 @@ public class NodeTool
System.out.printf("Note: Ownership information does not include topology; for complete information, specify a keyspace%n");
}
System.out.println();
for (Entry<String, SetHostStat> entry : getOwnershipByDc(probe, false, tokensToEndpoints, ownerships).entrySet())
for (Entry<String, SetHostStat> entry : getOwnershipByDc(probe, resolveIp, tokensToEndpoints, ownerships).entrySet())
printDc(probe, format, entry.getKey(), endpointsToTokens, entry.getValue());
if (DatabaseDescriptor.getNumTokens() > 1)
@ -529,7 +532,7 @@ public class NodeTool
? loadMap.get(endpoint)
: "?";
String owns = stat.owns != null ? new DecimalFormat("##0.00%").format(stat.owns) : "?";
System.out.printf(format, endpoint, rack, status, state, load, owns, stat.token);
System.out.printf(format, stat.ipOrDns(), rack, status, state, load, owns, stat.token);
}
System.out.println();
}