final Map<String, Sink> sinks = new HashMap<String, Sink>();
for (final String sinkName : sinkNames) {
final ComponentConfiguration comp = compMap.get(sinkName);
if (comp != null) {
final SinkConfiguration config = (SinkConfiguration) comp;
final Sink sink = sinkFactory.create(comp.getComponentName(), comp.getType());
Configurables.configure(sink, config);
sink.setChannel(conf.getChannels().get(config.getChannel()));
sinks.put(comp.getComponentName(), sink);
}
}
final Map<String, Context> sinkContexts = agentConf.getSinkContext();
for (final String sinkName : sinkNames) {
final Context context = sinkContexts.get(sinkName);
if (context != null) {
final Sink sink = sinkFactory.create(sinkName,
context.getString(BasicConfigurationConstants.CONFIG_TYPE));
Configurables.configure(sink, context);
sink.setChannel(conf.getChannels().get(context.getString(BasicConfigurationConstants.CONFIG_CHANNEL)));
sinks.put(sinkName, sink);
}
}
loadSinkGroups(agentConf, sinks, conf);