final Map<String, ComponentConfiguration> compMap = agentConf.getSinkConfigMap();
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();