Github user mcgilman commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1283#discussion_r91607077
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
---
@@ -1950,57 +1952,6 @@ private ProcessGroup getConnectableParent(final
ProcessGroup group, final String
}
}
- public void verifyComponentTypesInSnippet(final FlowSnippetDTO
templateContents) {
- // validate that all Processor Types and Prioritizer Types are
valid
- final Set<String> processorClasses = new HashSet<>();
- for (final Class<?> c :
ExtensionManager.getExtensions(Processor.class)) {
- processorClasses.add(c.getName());
- }
- final Set<String> prioritizerClasses = new HashSet<>();
- for (final Class<?> c :
ExtensionManager.getExtensions(FlowFilePrioritizer.class)) {
- prioritizerClasses.add(c.getName());
- }
- final Set<String> controllerServiceClasses = new HashSet<>();
- for (final Class<?> c :
ExtensionManager.getExtensions(ControllerService.class)) {
- controllerServiceClasses.add(c.getName());
- }
-
- final Set<ProcessorDTO> allProcs = new HashSet<>();
- final Set<ConnectionDTO> allConns = new HashSet<>();
- allProcs.addAll(templateContents.getProcessors());
- allConns.addAll(templateContents.getConnections());
- for (final ProcessGroupDTO childGroup :
templateContents.getProcessGroups()) {
- allProcs.addAll(findAllProcessors(childGroup));
- allConns.addAll(findAllConnections(childGroup));
- }
-
- for (final ProcessorDTO proc : allProcs) {
- if (!processorClasses.contains(proc.getType())) {
- throw new IllegalStateException("Invalid Processor Type: "
+ proc.getType());
- }
- }
-
- final Set<ControllerServiceDTO> controllerServices =
templateContents.getControllerServices();
- if (controllerServices != null) {
- for (final ControllerServiceDTO service : controllerServices) {
- if (!controllerServiceClasses.contains(service.getType()))
{
- throw new IllegalStateException("Invalid Controller
Service Type: " + service.getType());
- }
- }
- }
-
- for (final ConnectionDTO conn : allConns) {
- final List<String> prioritizers = conn.getPrioritizers();
- if (prioritizers != null) {
- for (final String prioritizer : prioritizers) {
- if (!prioritizerClasses.contains(prioritizer)) {
--- End diff --
Before we can remove this check I believe we need to provide support for
ghost Prioritizers. Otherwise, if a template references a Prioritizer that
doesn't exist in this NiFi instance we would throw an exception when
instantiating the Template.
Alternatively, we can keep this part of the verification in place. However,
I think the ghost Prioritizer would be the preferred approach.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---