final Map<String, Sink> sinks, final NodeConfiguration conf) {
final Set<String> sinkgroupNames = agentConf.getSinkgroupSet();
final Map<String, ComponentConfiguration> compMap = agentConf.getSinkGroupConfigMap();
final Map<String, String> usedSinks = new HashMap<String, String>();
for (final String groupName : sinkgroupNames) {
final ComponentConfiguration comp = compMap.get(groupName);
if (comp != null) {
final SinkGroupConfiguration groupConf = (SinkGroupConfiguration) comp;
final List<String> groupSinkList = groupConf.getSinks();
final List<Sink> groupSinks = new ArrayList<Sink>();
for (final String sink : groupSinkList) {
final Sink s = sinks.remove(sink);
if (s == null) {
final String sinkUser = usedSinks.get(sink);
if (sinkUser != null) {
throw new ConfigurationException(String.format(
"Sink %s of group %s already in use by group %s", sink, groupName, sinkUser));
} else {
throw new ConfigurationException(String.format(
"Sink %s of group %s does not exist or is not properly configured", sink,
groupName));
}
}
groupSinks.add(s);
usedSinks.put(sink, groupName);
}
final SinkGroup group = new SinkGroup(groupSinks);
Configurables.configure(group, groupConf);
conf.getSinkRunners().put(comp.getComponentName(), new SinkRunner(group.getProcessor()));
}
}
// add any unassigned sinks to solo collectors
for (final Map.Entry<String, Sink> entry : sinks.entrySet()) {
if (!usedSinks.containsValue(entry.getKey())) {