Search in sources :

Example 1 with TranslationContext

use of org.smartdata.server.rule.parser.TranslationContext in project SSM by Intel-bigdata.

the class RuleContainer method doLaunchExecutor.

private RuleQueryExecutor doLaunchExecutor(RuleManager ruleManager) throws IOException {
    RuleState state = ruleInfo.getState();
    if (state == RuleState.ACTIVE || state == RuleState.DRYRUN) {
        if (executor != null && !executor.isExited()) {
            return null;
        }
        ExecutionContext ctx = new ExecutionContext();
        ctx.setProperty(ExecutionContext.RULE_ID, ruleInfo.getId());
        TranslationContext transCtx = new TranslationContext(ruleInfo.getId(), ruleInfo.getSubmitTime());
        TranslateResult tr = executor != null ? executor.getTranslateResult() : ruleManager.doCheckRule(ruleInfo.getRuleText(), transCtx);
        executor = new RuleQueryExecutor(ruleManager, ctx, tr, ruleManager.getDbAdapter());
        return executor;
    }
    return null;
}
Also used : RuleState(org.smartdata.common.rule.RuleState) ExecutionContext(org.smartdata.server.metastore.ExecutionContext) TranslateResult(org.smartdata.server.rule.parser.TranslateResult) TranslationContext(org.smartdata.server.rule.parser.TranslationContext)

Aggregations

RuleState (org.smartdata.common.rule.RuleState)1 ExecutionContext (org.smartdata.server.metastore.ExecutionContext)1 TranslateResult (org.smartdata.server.rule.parser.TranslateResult)1 TranslationContext (org.smartdata.server.rule.parser.TranslationContext)1