MemoryBackedConfigStore extends ConfigStore { @Override public void setConfig(String host, String flowid, String source, String sink) throws IOException { Preconditions.checkArgument(host != null, "Attempted to set config but missing host name!"); Preconditions.checkArgument(flowid != null, "Attempted to set config " + host + " but missing flowid!"); Preconditions.checkArgument(source != null, "Attempted to set config " + host + " but missing source!"); Preconditions.checkArgument(sink != null, "Attempted to set config " + host + " but missing sink"); long time = Clock.unixTime(); cfgs.put(host, new FlumeConfigData(time, source, sink, time, time, flowid)); }  @Override FlumeConfigData getConfig(String host); @Override void setConfig(String host, String flowid, String source, String sink); @Override Map<String, FlumeConfigData> getConfigs(); void addChokeLimit(String physNode, String chokeID, int limit); void addLogicalNode(String physNode, String logicNode); List<String> getLogicalNodes(String physNode); @Override Multimap<String, String> getLogicalNodeMap(); @Override void bulkSetConfig(Map<String, FlumeConfigData> configs); @Override void removeLogicalNode(String logicNode); @Override void unmapLogicalNode(String physNode, String logicNode); @Override void init(); @Override void shutdown(); @Override void unmapAllLogicalNodes(); @Override Map<String, Integer> getChokeMap(String physNode);  }
@Test(expected = IllegalArgumentException.class) public void testNullHost() throws IOException { MemoryBackedConfigStore store = new MemoryBackedConfigStore(); ConfigManager manager = new ConfigManager(store); manager.setConfig(null, "my-test-flow", "null", "console"); }
@Test(expected = IllegalArgumentException.class) public void testNullFlow() throws IOException { MemoryBackedConfigStore store = new MemoryBackedConfigStore(); ConfigManager manager = new ConfigManager(store); manager.setConfig("host", null, "null", "console"); }
@Test(expected = IllegalArgumentException.class) public void testNullSource() throws IOException { MemoryBackedConfigStore store = new MemoryBackedConfigStore(); ConfigManager manager = new ConfigManager(store); manager.setConfig("host", "flow", null, "console"); }
@Test(expected = IllegalArgumentException.class) public void testNullSink() throws IOException { MemoryBackedConfigStore store = new MemoryBackedConfigStore(); ConfigManager manager = new ConfigManager(store); manager.setConfig("host", "flow", "null", null); }