@Override public synchronized List<String> resolve(List<String> names) { if (map == null) { map = load(); if (map == null) { LOG.warn("Failed to read topology table. " + NetworkTopology.DEFAULT_RACK + " will be used for all nodes."); map = new HashMap<String, String>(); } } List<String> results = new ArrayList<String>(names.size()); for (String name : names) { String result = map.get(name); if (result != null) { results.add(result); } else { results.add(NetworkTopology.DEFAULT_RACK); } } return results; }
@Override public void reloadCachedMappings() { Map<String, String> newMap = load(); if (newMap == null) { LOG.error("Failed to reload the topology table. The cached " + "mappings will not be cleared."); } else { synchronized(this) { map = newMap; } } }
@Override public synchronized List<String> resolve(List<String> names) { if (map == null) { map = load(); if (map == null) { LOG.warn("Failed to read topology table. " + NetworkTopology.DEFAULT_RACK + " will be used for all nodes."); map = new HashMap<String, String>(); } } List<String> results = new ArrayList<String>(names.size()); for (String name : names) { String result = map.get(name); if (result != null) { results.add(result); } else { results.add(NetworkTopology.DEFAULT_RACK); } } return results; }
@Override public synchronized List<String> resolve(List<String> names) { if (map == null) { map = load(); if (map == null) { LOG.warn("Failed to read topology table. " + NetworkTopology.DEFAULT_RACK + " will be used for all nodes."); map = new HashMap<String, String>(); } } List<String> results = new ArrayList<String>(names.size()); for (String name : names) { String result = map.get(name); if (result != null) { results.add(result); } else { results.add(NetworkTopology.DEFAULT_RACK); } } return results; }
@Override public synchronized List<String> resolve(List<String> names) { if (map == null) { map = load(); if (map == null) { LOG.warn("Failed to read topology table. " + NetworkTopology.DEFAULT_RACK + " will be used for all nodes."); map = new HashMap<String, String>(); } } List<String> results = new ArrayList<String>(names.size()); for (String name : names) { String result = map.get(name); if (result != null) { results.add(result); } else { results.add(NetworkTopology.DEFAULT_RACK); } } return results; }
@Override public synchronized List<String> resolve(List<String> names) { if (map == null) { map = load(); if (map == null) { LOG.warn("Failed to read topology table. " + NetworkTopology.DEFAULT_RACK + " will be used for all nodes."); map = new HashMap<String, String>(); } } List<String> results = new ArrayList<String>(names.size()); for (String name : names) { String result = map.get(name); if (result != null) { results.add(result); } else { results.add(NetworkTopology.DEFAULT_RACK); } } return results; }
@Override public void reloadCachedMappings() { Map<String, String> newMap = load(); if (newMap == null) { LOG.error("Failed to reload the topology table. The cached " + "mappings will not be cleared."); } else { synchronized(this) { map = newMap; } } }
@Override public void reloadCachedMappings() { Map<String, String> newMap = load(); if (newMap == null) { LOG.error("Failed to reload the topology table. The cached " + "mappings will not be cleared."); } else { synchronized(this) { map = newMap; } } }
@Override public void reloadCachedMappings() { Map<String, String> newMap = load(); if (newMap == null) { LOG.error("Failed to reload the topology table. The cached " + "mappings will not be cleared."); } else { synchronized(this) { map = newMap; } } }
@Override public void reloadCachedMappings() { Map<String, String> newMap = load(); if (newMap == null) { LOG.error("Failed to reload the topology table. The cached " + "mappings will not be cleared."); } else { synchronized(this) { map = newMap; } } }