use of com.hortonworks.streamline.streams.layout.component.rule.Rule in project streamline by hortonworks.
the class RulesProcessor method setRules.
public void setRules(List<Rule> rules) {
this.rules = rules;
Set<String> streamIds = new HashSet<>(Collections2.transform(getOutputStreams(), new Function<Stream, String>() {
@Override
public String apply(Stream input) {
return input.getId();
}
}));
for (Rule rule : rules) {
for (Action action : rule.getActions()) {
for (String stream : action.getOutputStreams()) {
if (!streamIds.contains(stream)) {
String errorMsg = String.format("Action [%s] stream [%s] does not exist in processor [%s]'s output streams [%s]", action, stream, getName(), streamIds);
log.error(errorMsg);
throw new IllegalArgumentException(errorMsg);
}
}
}
}
}
Aggregations