use of org.ballerinalang.siddhi.core.util.transport.TemplateBuilder in project ballerina by ballerina-lang.
the class SinkMapper method init.
public final void init(StreamDefinition streamDefinition, String type, OptionHolder mapOptionHolder, List<Element> unmappedPayloadList, Sink sink, ConfigReader mapperConfigReader, LatencyTracker mapperLatencyTracker, SiddhiAppContext siddhiAppContext) {
this.mapperLatencyTracker = mapperLatencyTracker;
this.siddhiAppContext = siddhiAppContext;
sink.setTrpDynamicOptions(trpDynamicOptions);
this.sinkListener = sink;
this.optionHolder = mapOptionHolder;
this.type = type;
if (unmappedPayloadList != null && !unmappedPayloadList.isEmpty()) {
templateBuilderMap = new HashMap<>();
for (Element e : unmappedPayloadList) {
TemplateBuilder templateBuilder = new TemplateBuilder(streamDefinition, e.getValue());
if (templateBuilderMap.containsKey(e.getKey())) {
throw new SiddhiAppCreationException("Duplicate Keys, " + e.getKey() + ", in @payload() ");
}
templateBuilderMap.put(e.getKey(), templateBuilder);
}
}
init(streamDefinition, mapOptionHolder, templateBuilderMap, mapperConfigReader, siddhiAppContext);
}
Aggregations