App buildApp() {
/* Stream to PE writing. */
for (StreamBuilder<? extends Event> sb : streamBuilders) {
for (String peName : sb.pes) {
ProcessingElement pe = getPE(peName);
sb.stream.setPE(pe);
}
}
/* PE to Stream wiring. */
Map<ProcessingElement, Collection<StreamBuilder<? extends Event>>> pe2streamMap = pe2stream.asMap();
for (Map.Entry<ProcessingElement, Collection<StreamBuilder<? extends Event>>> entry : pe2streamMap.entrySet()) {
ProcessingElement pe = entry.getKey();
Collection<StreamBuilder<? extends Event>> streams = entry.getValue();
if (pe != null && streams != null) {
try {
setStreamField(pe, streams);