public Map<Range<Token>, List<InetAddress>> getRangeToAddressMap(String keyspace) { return getRangeToAddressMap(keyspace, tokenMetadata.sortedTokens()); }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMap(String keyspace) { return getRangeToAddressMap(keyspace, tokenMetadata.sortedTokens()); }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMap(String keyspace) { return getRangeToAddressMap(keyspace, tokenMetadata.sortedTokens()); }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMap(String keyspace) { return getRangeToAddressMap(keyspace, tokenMetadata.sortedTokens()); }
public void init(String keyspace) { this.keyspace = keyspace; try { for (Map.Entry<Range<Token>, List<InetAddress>> entry : StorageService.instance.getRangeToAddressMap(keyspace).entrySet()) { Range<Token> range = entry.getKey(); for (InetAddress endpoint : entry.getValue()) addRangeForEndpoint(range, endpoint); } } catch (Exception e) { throw new RuntimeException(e); } }
public void init(String keyspace) { this.keyspace = keyspace; try { for (Map.Entry<Range<Token>, List<InetAddress>> entry : StorageService.instance.getRangeToAddressMap(keyspace).entrySet()) { Range<Token> range = entry.getKey(); for (InetAddress endpoint : entry.getValue()) addRangeForEndpoint(range, endpoint); } } catch (Exception e) { throw new RuntimeException(e); } }
public void init(String keyspace) { this.keyspace = keyspace; try { for (Map.Entry<Range<Token>, List<InetAddress>> entry : StorageService.instance.getRangeToAddressMap(keyspace).entrySet()) { Range<Token> range = entry.getKey(); for (InetAddress endpoint : entry.getValue()) addRangeForEndpoint(range, endpoint); } } catch (Exception e) { throw new RuntimeException(e); } }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMapInLocalDC(String keyspace) { Predicate<InetAddress> isLocalDC = new Predicate<InetAddress>() { public boolean apply(InetAddress address) { return isLocalDC(address); } }; Map<Range<Token>, List<InetAddress>> origMap = getRangeToAddressMap(keyspace, getTokensInLocalDC()); Map<Range<Token>, List<InetAddress>> filteredMap = Maps.newHashMap(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : origMap.entrySet()) { List<InetAddress> endpointsInLocalDC = Lists.newArrayList(Collections2.filter(entry.getValue(), isLocalDC)); filteredMap.put(entry.getKey(), endpointsInLocalDC); } return filteredMap; }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMapInLocalDC(String keyspace) { Predicate<InetAddress> isLocalDC = new Predicate<InetAddress>() { public boolean apply(InetAddress address) { return isLocalDC(address); } }; Map<Range<Token>, List<InetAddress>> origMap = getRangeToAddressMap(keyspace, getTokensInLocalDC()); Map<Range<Token>, List<InetAddress>> filteredMap = Maps.newHashMap(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : origMap.entrySet()) { List<InetAddress> endpointsInLocalDC = Lists.newArrayList(Collections2.filter(entry.getValue(), isLocalDC)); filteredMap.put(entry.getKey(), endpointsInLocalDC); } return filteredMap; }
/** * for a keyspace, return the ranges and corresponding listen addresses. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToEndpointMap(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()) { map.put(entry.getKey().asList(), stringify(entry.getValue())); } return map; }
/** * for a keyspace, return the ranges and corresponding listen addresses. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToEndpointMap(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()) { map.put(entry.getKey().asList(), stringify(entry.getValue())); } return map; }
/** * for a keyspace, return the ranges and corresponding listen addresses. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToEndpointMap(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()) { map.put(entry.getKey().asList(), stringify(entry.getValue())); } return map; }
/** * for a keyspace, return the ranges and corresponding listen addresses. * @param keyspace * @return the endpoint map */ public Map<List<String>, List<String>> getRangeToEndpointMap(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()) { map.put(entry.getKey().asList(), stringify(entry.getValue())); } 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; }
/** * 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; }
public void init(String keyspace) { try { setPartitioner(DatabaseDescriptor.getPartitioner()); for (Map.Entry<Range<Token>, List<InetAddress>> entry : StorageService.instance.getRangeToAddressMap(keyspace).entrySet()) { Range<Token> range = entry.getKey(); for (InetAddress endpoint : entry.getValue()) addRangeForEndpoint(range, endpoint); } } catch (Exception e) { throw new RuntimeException(e); } }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMapInLocalDC(String keyspace) { Predicate<InetAddress> isLocalDC = new Predicate<InetAddress>() { public boolean apply(InetAddress address) { return isLocalDC(address); } }; Map<Range<Token>, List<InetAddress>> origMap = getRangeToAddressMap(keyspace, getTokensInLocalDC()); Map<Range<Token>, List<InetAddress>> filteredMap = Maps.newHashMap(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : origMap.entrySet()) { List<InetAddress> endpointsInLocalDC = Lists.newArrayList(Collections2.filter(entry.getValue(), isLocalDC)); filteredMap.put(entry.getKey(), endpointsInLocalDC); } return filteredMap; }
public Map<Range<Token>, List<InetAddress>> getRangeToAddressMapInLocalDC(String keyspace) { Predicate<InetAddress> isLocalDC = new Predicate<InetAddress>() { public boolean apply(InetAddress address) { return isLocalDC(address); } }; Map<Range<Token>, List<InetAddress>> origMap = getRangeToAddressMap(keyspace, getTokensInLocalDC()); Map<Range<Token>, List<InetAddress>> filteredMap = Maps.newHashMap(); for (Map.Entry<Range<Token>, List<InetAddress>> entry : origMap.entrySet()) { List<InetAddress> endpointsInLocalDC = Lists.newArrayList(Collections2.filter(entry.getValue(), isLocalDC)); filteredMap.put(entry.getKey(), endpointsInLocalDC); } return filteredMap; }