public CustomProcessorInfo removeCustomProcessorInfoAsBundle(String name) throws IOException { List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam(CustomProcessorInfo.NAME, name)); Collection<TopologyComponentBundle> result = this.listCustomProcessorBundlesWithFilter(queryParams); if (result.isEmpty() || result.size() != 1) { throw new IOException("Failed to delete custom processor with name:" + name); } TopologyComponentBundle customProcessorBundle = result.iterator().next(); Collection<TopologyProcessor> processors = this.listTopologyProcessors(); if (processors != null && !processors.isEmpty()) { for (TopologyProcessor topologyProcessor: processors) { if (topologyProcessor.getTopologyComponentBundleId().equals(customProcessorBundle.getId())) { throw new IOException("Cannot delete custom processor as it is being used in one of the topologies."); } } } this.removeTopologyComponentBundle(customProcessorBundle.getId()); return CustomProcessorInfo.fromTopologyComponentBundle(customProcessorBundle); }
for (TopologyProcessor processor : processors) { BiFunction<TopologyProcessor, Long, BaseTopologyRule> function; if ((function = bundles.get(processor.getTopologyComponentBundleId())) != null) { Optional<Object> ruleList = processor.getConfig().getAnyOptional(RulesProcessor.CONFIG_KEY_RULES); if (ruleList.isPresent()) {
topologyProcessor.setTopologyId(newTopology.getId()); TopologyComponentBundle bundle; String subType = topologyData.getBundleIdToType().get(topologyProcessor.getTopologyComponentBundleId().toString()); if (TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_SUB_TYPE.equals(subType)) { QueryParam queryParam = new QueryParam(CustomProcessorInfo.NAME, topologyProcessor.getConfig().get(CustomProcessorInfo.NAME));