use of com.hortonworks.streamline.streams.runtime.script.Script in project streamline by hortonworks.
the class RuleProcessorRuntime method initializeRuleRuntimes.
private void initializeRuleRuntimes(Map<String, Object> config) {
List<Rule> rules = rulesProcessor.getRules();
if (rules != null) {
for (Rule rule : rules) {
RuleRuntime ruleRuntime;
Script script = null;
if (ScriptType.GROOVY.equals(scriptType)) {
script = createGroovyScript(rule);
} else if (ScriptType.SQL.equals(scriptType)) {
script = createSqlScript(rule);
} else {
throw new RuntimeException("Ruleruntime scriptType unsupported: " + scriptType);
}
ruleRuntime = new RuleRuntime(rule, script, createActionRuntimes(rule));
rulesRuntime.add(ruleRuntime);
ruleRuntime.initialize(config);
}
LOG.info("ruleRuntimes [{}]", rulesRuntime);
}
}
Aggregations