use of org.smartdata.server.engine.rule.RuleExecutor in project SSM by Intel-bigdata.
the class RuleManager method start.
/**
* Start services.
*/
@Override
public void start() throws IOException {
LOG.info("Starting ...");
// after StateManager be ready
int numLaunched = 0;
// Submit runnable rules to scheduler
for (RuleInfoRepo infoRepo : mapRules.values()) {
RuleInfo rule = infoRepo.getRuleInfoRef();
if (rule.getState() == RuleState.ACTIVE || rule.getState() == RuleState.DRYRUN) {
RuleExecutor ruleExecutor = infoRepo.launchExecutor(this);
TranslateResult tr = ruleExecutor.getTranslateResult();
TimeBasedScheduleInfo si = tr.getTbScheduleInfo();
if (rule.getLastCheckTime() != 0) {
si.setFirstCheckTime(rule.getLastCheckTime());
}
boolean sub = submitRuleToScheduler(ruleExecutor);
numLaunched += sub ? 1 : 0;
}
}
LOG.info("Started. " + numLaunched + " rules launched for execution.");
}
Aggregations