[ 
https://issues.apache.org/jira/browse/NIFI-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15833729#comment-15833729
 ] 

ASF GitHub Bot commented on NIFI-3350:
--------------------------------------

Github user jvwing commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1416#discussion_r97235889
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarUnpacker.java
 ---
    @@ -264,7 +264,9 @@ private static void unpack(final File nar, final File 
workingDirectory, final by
         private static void unpackDocumentation(final File jar, final File 
docsDirectory,
                 final ExtensionMapping extensionMapping) throws IOException {
             // determine the components that may have documentation
    -        determineDocumentedNiFiComponents(jar, extensionMapping);
    --- End diff --
    
    Because the ExtensionMapping is passed around by reference, I believe it 
was theoretically possible to have documentation for a component in a separate 
JAR, as long as it happened to processed after the components were identified 
and added to the ExtensionMapping.  This optimization restricts that a bit, 
documentation is now only processed in JARs that contain at least one 
component, although the relationship between components and documentation in 
the same JAR is not enforced.
    
    This doesn't strike me as a problem for several reasons - I suspect the 
code behavior is unintentional, no bundled JARs take advantage of it, and 
because the Developer Guide instructs developers to [include documentation in 
the component 
JAR](https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html#advanced-documentation):
    
    > The advanced documentation of a Processor is provided as an HTML file 
named additionalDetails.html. This file should exist within a directory whose 
name is the fully-qualified name of the Processor, and this directory’s parent 
should be named docs and exist in the root of the Processor’s jar.


> Reduce NiFi startup time by streamlining documentation extraction
> -----------------------------------------------------------------
>
>                 Key: NIFI-3350
>                 URL: https://issues.apache.org/jira/browse/NIFI-3350
>             Project: Apache NiFi
>          Issue Type: Improvement
>    Affects Versions: 0.7.1, 1.1.1
>            Reporter: Michael Moser
>            Assignee: Michael Moser
>         Attachments: nifi-3350-doc-optimization-results-1.png
>
>
> On NiFi startup, after seeing the new log message added in NIFI-3164, I 
> noticed that generating documentation of all components takes a long time.  
> After reading the NarUnpacker code, it appears to scan every file in every 
> jar for NiFi component documentation.  I think there are some optimizations 
> we can do here  which should reduce NiFi startup time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to