final long timeout = configuration.getStreamProcessingTimeout();
final int maxFaultCount = configuration.getStreamProcessingMaxFaults();
for (final Stream stream : streams) {
final Timer timer = getExecutionTimer(stream.getId());
Callable<Boolean> task = new Callable<Boolean>() {
public Boolean call() {
Map<StreamRule, Boolean> result = getRuleMatches(stream, msg);
return doesStreamMatch(result);
}
};
try (final Timer.Context timerContext = timer.time()) {
boolean matched = timeLimiter.callWithTimeout(task, timeout, TimeUnit.MILLISECONDS, true);
if (matched) {
getIncomingMeter(stream.getId()).mark();
matches.add(stream);
}