Search in sources :

Example 1 with Trigger

use of io.siddhi.core.trigger.Trigger in project siddhi by wso2.

the class SiddhiAppRuntimeImpl method startWithoutSources.

public synchronized void startWithoutSources() {
    if (running || runningWithoutSources) {
        log.warn("Error calling startWithoutSources() for Siddhi App '" + siddhiAppContext.getName() + "', " + "SiddhiApp already started.");
    } else {
        try {
            memoryUsageTracker.disableMemoryUsageMetrics();
            if (siddhiAppContext.getRootMetricsLevel().compareTo(Level.OFF) != 0 && siddhiAppContext.getStatisticsManager() != null) {
                if (siddhiAppContext.getRootMetricsLevel().compareTo(Level.DETAIL) == 0) {
                    memoryUsageTracker.enableMemoryUsageMetrics();
                }
                siddhiAppContext.getStatisticsManager().startReporting();
            }
            for (ExternalReferencedHolder externalReferencedHolder : siddhiAppContext.getExternalReferencedHolders()) {
                externalReferencedHolder.start();
            }
            for (List<Sink> sinks : sinkMap.values()) {
                for (Sink sink : sinks) {
                    sink.connectWithRetry();
                }
            }
            for (Table table : tableMap.values()) {
                table.connectWithRetry();
            }
            for (StreamJunction streamJunction : streamJunctionMap.values()) {
                streamJunction.startProcessing();
            }
            if (incrementalDataPurging) {
                for (AggregationRuntime aggregationRuntime : aggregationMap.values()) {
                    aggregationRuntime.startPurging();
                }
            }
            for (Trigger trigger : siddhiAppContext.getTriggerHolders()) {
                trigger.start();
            }
            inputManager.connect();
            runningWithoutSources = true;
        } catch (Throwable t) {
            log.error("Error starting Siddhi App '" + siddhiAppContext.getName() + "', " + "triggering shutdown process. " + t.getMessage());
            try {
                shutdown();
            } catch (Throwable t1) {
                log.error("Error shutting down partially started Siddhi App '" + siddhiAppContext.getName() + "', " + t1.getMessage());
            }
        }
    }
}
Also used : Table(io.siddhi.core.table.Table) Trigger(io.siddhi.core.trigger.Trigger) Sink(io.siddhi.core.stream.output.sink.Sink) StreamJunction(io.siddhi.core.stream.StreamJunction) ExternalReferencedHolder(io.siddhi.core.util.extension.holder.ExternalReferencedHolder) AggregationRuntime(io.siddhi.core.aggregation.AggregationRuntime)

Aggregations

AggregationRuntime (io.siddhi.core.aggregation.AggregationRuntime)1 StreamJunction (io.siddhi.core.stream.StreamJunction)1 Sink (io.siddhi.core.stream.output.sink.Sink)1 Table (io.siddhi.core.table.Table)1 Trigger (io.siddhi.core.trigger.Trigger)1 ExternalReferencedHolder (io.siddhi.core.util.extension.holder.ExternalReferencedHolder)1