private static Map<String, SetHostStat> getOwnershipByDc(NodeProbe probe, boolean resolveIp,
Map<String, String> tokenToEndpoint,
Map<InetAddress, Float> ownerships)
{
Map<String, SetHostStat> ownershipByDc = Maps.newLinkedHashMap();
EndpointSnitchInfoMBean epSnitchInfo = probe.getEndpointSnitchInfoProxy();
try
{
for (Entry<String, String> tokenAndEndPoint : tokenToEndpoint.entrySet())
{
String dc = epSnitchInfo.getDatacenter(tokenAndEndPoint.getValue());
if (!ownershipByDc.containsKey(dc))
ownershipByDc.put(dc, new SetHostStat(resolveIp));
ownershipByDc.get(dc).add(tokenAndEndPoint.getKey(), tokenAndEndPoint.getValue(), ownerships);
}
}