private Map<String, String> load() { Map<String, String> loadMap = new HashMap<String, String>(); String filename = getConf().get(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY, null); if (StringUtils.isBlank(filename)) { LOG.warn(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY + " not configured. "); return null; } try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(filename), StandardCharsets.UTF_8))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.length() != 0 && line.charAt(0) != '#') { String[] columns = line.split("\\s+"); if (columns.length == 2) { loadMap.put(columns[0], columns[1]); } else { LOG.warn("Line does not have two columns. Ignoring. " + line); } } line = reader.readLine(); } } catch (Exception e) { LOG.warn(filename + " cannot be read.", e); return null; } return loadMap; }
private Map<String, String> load() { Map<String, String> loadMap = new HashMap<String, String>(); String filename = getConf().get(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY, null); if (StringUtils.isBlank(filename)) { LOG.warn(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY + " not configured. "); return null; } try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(filename), Charsets.UTF_8))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.length() != 0 && line.charAt(0) != '#') { String[] columns = line.split("\\s+"); if (columns.length == 2) { loadMap.put(columns[0], columns[1]); } else { LOG.warn("Line does not have two columns. Ignoring. " + line); } } line = reader.readLine(); } } catch (Exception e) { LOG.warn(filename + " cannot be read.", e); return null; } return loadMap; }
private Map<String, String> load() { Map<String, String> loadMap = new HashMap<String, String>(); String filename = getConf().get(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY, null); if (StringUtils.isBlank(filename)) { LOG.warn(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY + " not configured. "); return null; } try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(filename), Charsets.UTF_8))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.length() != 0 && line.charAt(0) != '#') { String[] columns = line.split("\\s+"); if (columns.length == 2) { loadMap.put(columns[0], columns[1]); } else { LOG.warn("Line does not have two columns. Ignoring. " + line); } } line = reader.readLine(); } } catch (Exception e) { LOG.warn(filename + " cannot be read.", e); return null; } return loadMap; }
private Map<String, String> load() { Map<String, String> loadMap = new HashMap<String, String>(); String filename = getConf().get(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY, null); if (StringUtils.isBlank(filename)) { LOG.warn(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY + " not configured. "); return null; } try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(filename), Charsets.UTF_8))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.length() != 0 && line.charAt(0) != '#') { String[] columns = line.split("\\s+"); if (columns.length == 2) { loadMap.put(columns[0], columns[1]); } else { LOG.warn("Line does not have two columns. Ignoring. " + line); } } line = reader.readLine(); } } catch (Exception e) { LOG.warn(filename + " cannot be read.", e); return null; } return loadMap; }
private Map<String, String> load() { Map<String, String> loadMap = new HashMap<String, String>(); String filename = getConf().get(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY, null); if (StringUtils.isBlank(filename)) { LOG.warn(NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY + " not configured. "); return null; } try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(filename), StandardCharsets.UTF_8))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.length() != 0 && line.charAt(0) != '#') { String[] columns = line.split("\\s+"); if (columns.length == 2) { loadMap.put(columns[0], columns[1]); } else { LOG.warn("Line does not have two columns. Ignoring. " + line); } } line = reader.readLine(); } } catch (Exception e) { LOG.warn(filename + " cannot be read.", e); return null; } return loadMap; }
@Override public Configuration getConf() { return getRawMapping().getConf(); }
@Override public Configuration getConf() { return getRawMapping().getConf(); }
@Override public Configuration getConf() { return getRawMapping().getConf(); }
@Override public Configuration getConf() { return getRawMapping().getConf(); }
@Override public Configuration getConf() { return getRawMapping().getConf(); }