private void setIfGreater(String key, int value) { Integer curVal = topologyConfig.getInt(key, DELTA); if (value > curVal) { topologyConfig.setAny(key, value); } }
private void updateNotifierJarFileName(TopologySink sink) { String notifierClassName = sink.getConfig().getString(Notifier.CLASS_NAME, ""); if (!notifierClassName.isEmpty()) { Collection<Notifier> notifiers = listNotifierInfos(QueryParam.params(Notifier.CLASS_NAME, notifierClassName)); if (notifiers.isEmpty()) { throw new IllegalStateException("No registered notifier in the cluster for class '" + notifierClassName + "'"); } Notifier current = notifiers.iterator().next(); sink.getConfig().setAny(Notifier.JARFILE_NAME, current.getJarFileName()); } }
private void handleNonWindowedRules(RulesProcessor rulesProcessor, List<Rule> rulesWithoutWindow) { rulesProcessor.setRules(rulesWithoutWindow); rulesProcessor.getConfig().setAny(RulesProcessor.CONFIG_KEY_RULES, Collections2.transform(rulesWithoutWindow, new Function<Rule, Long>() { @Override public Long apply(Rule input) { return input.getId(); } })); keysAndComponents.add(makeEntry(StormTopologyLayoutConstants.YAML_KEY_BOLTS, getYamlComponents(fluxComponentFactory.getFluxComponent(rulesProcessor), rulesProcessor))); }
@Override public void visit(final RulesProcessor rulesProcessor) { rulesProcessor.getConfig().setAny("outputStreams", rulesProcessor.getOutputStreams()); List<Rule> rulesWithWindow = new ArrayList<>(); List<Rule> rulesWithoutWindow = new ArrayList<>();
windowedRulesProcessor.setId(rulesProcessor.getId()); windowedRulesProcessor.setName(rulesProcessor.getName()); windowedRulesProcessor.getConfig().setAny(RulesProcessor.CONFIG_KEY_RULES, Collections2.transform(rules, new Function<Rule, Long>() { @Override public Long apply(Rule input) {
ruleIds.forEach(ruleId -> updatedRuleIds.add(oldToNewWindowIds.get(ruleId))); topologyProcessor.getConfig().setAny(RulesProcessor.CONFIG_KEY_RULES, updatedRuleIds); }); addTopologyProcessor(newTopology.getId(), topologyProcessor);