public List<HostPort> parseHostString() { // Done manually to avoid a guava dep List<HostPort> hosts = new ArrayList<HostPort>(); String[] hostPairs = getHostsString().split(","); for (int i = 0; i < hostPairs.length; i++) { String[] pair = hostPairs[i].split(":"); hosts.add(new HostPort(pair[0], Integer.valueOf(pair[1]))); } return hosts; }
public List<HostPort> parseHostString() { // Done manually to avoid a guava dep List<HostPort> hosts = new ArrayList<HostPort>(); String[] hostPairs = getHostsString().split(","); for (int i = 0; i < hostPairs.length; i++) { String[] pair = hostPairs[i].split(":"); hosts.add(new HostPort(pair[0], Integer.valueOf(pair[1]))); } return hosts; }
protected HostPort makeHostPort(Map<String,String> chan) { if (chan.containsKey("mcast_join") || chan.containsKey("mcast_if")) { log.warn("Looks like a multicast send channel, not supported and ignoring: {}", chan); return null; } HostPort hp = null; try { hp = new HostPort(chan.get("host"), (Integer.valueOf(chan.get("port")))); } catch (Exception e) { // beter with slf4j 1.7 log.warn("Failed to create HostPort for:" + chan, e); } return hp; }
public HostPort makeHostPort(Map<String,String> chan) { if (chan.containsKey("mcast_join") || chan.containsKey("mcast_if")) { log.warn("Looks like a multicast send channel, not supported and ignoring: {}", chan); return null; } HostPort hp = null; try { hp = new HostPort(chan.get("host"), Integer.valueOf(chan.get("port"))); } catch (Exception e) { // beter with slf4j 1.7 log.warn("Failed to create HostPort for:" + chan, e); } return hp; }
@Test public void validationWorks() throws IOException { assertFalse(ReporterConfig.validate(new HostPort())); }
@Test public void validationWorks() throws IOException { assertFalse(ReporterConfig.validate(new HostPort())); }