List<String> rpc_endpoints = new ArrayList<String>();
List<EndpointDetails> epDetails = new ArrayList<EndpointDetails>();
for (InetAddress endpoint : entry.getValue())
{
EndpointState eps = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
EndpointDetails details = new EndpointDetails();
if (endpoint.equals(FBUtilities.getBroadcastAddress()))
details.host = DatabaseDescriptor.getRpcAddress().getHostAddress();
else if (eps.getApplicationState(ApplicationState.RPC_ADDRESS) == null)
details.host = endpoint.getHostAddress();
else
details.host = eps.getApplicationState(ApplicationState.RPC_ADDRESS).value;
details.datacenter = DatabaseDescriptor.getEndpointSnitch().getDatacenter(endpoint);
endpoints.add(details.host);
rpc_endpoints.add(StorageService.instance.getRpcaddress(endpoint));