private InetAddress getRpcAddress(InetAddress endpoint) { try { InetAddress rpcAddress = InetAddress.getByName(StorageService.instance.getRpcaddress(endpoint)); // If rpcAddress == 0.0.0.0 (i.e. bound on all addresses), returning that is not very helpful, // so return the internal address (which is ok since "we're bound on all addresses"). // Note that after all nodes are running a version that includes CASSANDRA-5899, rpcAddress should // never be 0.0.0.0, so this can eventually be removed. return rpcAddress.equals(bindAll) ? endpoint : rpcAddress; } catch (UnknownHostException e) { // That should not happen, so log an error, but return the // endpoint address since there's a good change this is right logger.error("Problem retrieving RPC address for {}", endpoint, e); return endpoint; } }
private InetAddress getRpcAddress(InetAddress endpoint) { try { InetAddress rpcAddress = InetAddress.getByName(StorageService.instance.getRpcaddress(endpoint)); // If rpcAddress == 0.0.0.0 (i.e. bound on all addresses), returning that is not very helpful, // so return the internal address (which is ok since "we're bound on all addresses"). // Note that after all nodes are running a version that includes CASSANDRA-5899, rpcAddress should // never be 0.0.0.0, so this can eventually be removed. return rpcAddress.equals(bindAll) ? endpoint : rpcAddress; } catch (UnknownHostException e) { // That should not happen, so log an error, but return the // endpoint address since there's a good change this is right logger.error("Problem retrieving RPC address for {}", endpoint, e); return endpoint; } }
private InetAddress getRpcAddress(InetAddress endpoint) { try { InetAddress rpcAddress = InetAddress.getByName(StorageService.instance.getRpcaddress(endpoint)); // If rpcAddress == 0.0.0.0 (i.e. bound on all addresses), returning that is not very helpful, // so return the internal address (which is ok since "we're bound on all addresses"). // Note that after all nodes are running a version that includes CASSANDRA-5899, rpcAddress should // never be 0.0.0.0, so this can eventually be removed. return rpcAddress.equals(bindAll) ? endpoint : rpcAddress; } catch (UnknownHostException e) { // That should not happen, so log an error, but return the // endpoint address since there's a good change this is right logger.error("Problem retrieving RPC address for {}", endpoint, e); return endpoint; } }
private InetAddress getRpcAddress(InetAddress endpoint) { try { InetAddress rpcAddress = InetAddress.getByName(StorageService.instance.getRpcaddress(endpoint)); // If rpcAddress == 0.0.0.0 (i.e. bound on all addresses), returning that is not very helpful, // so return the internal address (which is ok since "we're bound on all addresses"). // Note that after all nodes are running a version that includes CASSANDRA-5899, rpcAddress should // never be 0.0.0.0, so this can eventually be removed. return rpcAddress.equals(bindAll) ? endpoint : rpcAddress; } catch (UnknownHostException e) { // That should not happen, so log an error, but return the // endpoint address since there's a good change this is right logger.error("Problem retrieving RPC address for {}", endpoint, e); return endpoint; } }
/** * for a keyspace, return the ranges and corresponding RPC addresses for a given keyspace. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToRpcaddressMap(String keyspace) { /* All the ranges for the tokens */ Map<List<String>, List<String>> map = new HashMap<>(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : getRangeToAddressMap(keyspace).entrySet()) { List<String> rpcaddrs = new ArrayList<>(entry.getValue().size()); for (InetAddress endpoint: entry.getValue()) { rpcaddrs.add(getRpcaddress(endpoint)); } map.put(entry.getKey().asList(), rpcaddrs); } return map; }
/** * for a keyspace, return the ranges and corresponding RPC addresses for a given keyspace. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToRpcaddressMap(String keyspace) { /* All the ranges for the tokens */ Map<List<String>, List<String>> map = new HashMap<>(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : getRangeToAddressMap(keyspace).entrySet()) { List<String> rpcaddrs = new ArrayList<>(entry.getValue().size()); for (InetAddress endpoint: entry.getValue()) { rpcaddrs.add(getRpcaddress(endpoint)); } map.put(entry.getKey().asList(), rpcaddrs); } return map; }
/** * for a keyspace, return the ranges and corresponding RPC addresses for a given keyspace. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToRpcaddressMap(String keyspace) { /* All the ranges for the tokens */ Map<List<String>, List<String>> map = new HashMap<>(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : getRangeToAddressMap(keyspace).entrySet()) { List<String> rpcaddrs = new ArrayList<>(entry.getValue().size()); for (InetAddress endpoint: entry.getValue()) { rpcaddrs.add(getRpcaddress(endpoint)); } map.put(entry.getKey().asList(), rpcaddrs); } return map; }
/** * for a keyspace, return the ranges and corresponding RPC addresses for a given keyspace. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToRpcaddressMap(String keyspace) { /* All the ranges for the tokens */ Map<List<String>, List<String>> map = new HashMap<>(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : getRangeToAddressMap(keyspace).entrySet()) { List<String> rpcaddrs = new ArrayList<>(entry.getValue().size()); for (InetAddress endpoint: entry.getValue()) { rpcaddrs.add(getRpcaddress(endpoint)); } map.put(entry.getKey().asList(), rpcaddrs); } return map; }
rpc_endpoints.add(getRpcaddress(endpoint));
rpc_endpoints.add(getRpcaddress(endpoint));
rpc_endpoints.add(getRpcaddress(endpoint));
rpc_endpoints.add(getRpcaddress(endpoint));