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

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

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

    https://github.com/apache/nifi/pull/2475#discussion_r169409286
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/html/HtmlDocumentationWriter.java
 ---
    @@ -727,6 +729,41 @@ protected void writeLink(final XMLStreamWriter 
xmlStreamWriter, final String tex
             xmlStreamWriter.writeEndElement();
         }
     
    +    /**
    +     * Writes all the system resource considerations for this component
    +     *
    +     * @param configurableComponent the component to describe
    +     * @param xmlStreamWriter the xml stream writer to use
    +     * @throws XMLStreamException thrown if there was a problem writing 
the XML
    +     */
    +    private void 
writeSystemResourceConsiderationInfo(ConfigurableComponent 
configurableComponent, XMLStreamWriter xmlStreamWriter)
    +            throws XMLStreamException {
    +
    +        SystemResourceConsideration[] systemResourceConsiderations = 
configurableComponent.getClass().getAnnotationsByType(SystemResourceConsideration.class);
    +
    +        writeSimpleElement(xmlStreamWriter, "h3", "System Resource 
Considerations:");
    +        if (systemResourceConsiderations.length > 0) {
    +            xmlStreamWriter.writeStartElement("table");
    +            xmlStreamWriter.writeAttribute("id", 
"system-resource-considerations");
    +            xmlStreamWriter.writeStartElement("tr");
    +            writeSimpleElement(xmlStreamWriter, "th", "Resource");
    +            writeSimpleElement(xmlStreamWriter, "th", "Description");
    +            xmlStreamWriter.writeEndElement();
    +            for (SystemResourceConsideration systemResourceConsideration : 
systemResourceConsiderations) {
    +                xmlStreamWriter.writeStartElement("tr");
    +                writeSimpleElement(xmlStreamWriter, "td", 
systemResourceConsideration.resource().name());
    +                // TODO allow for HTML characters here.
    --- End diff --
    
    That TODO is also present on the reads/writes attributes code in 
HtmlProcessorDocumentationWriter.  Since the functionality is similar, I added 
the TODO there as well.  Will have to talk to @mcgilman about the intention 
there.


> NIFI component high resource usage annotation
> ---------------------------------------------
>
>                 Key: NIFI-4872
>                 URL: https://issues.apache.org/jira/browse/NIFI-4872
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework, Core UI
>    Affects Versions: 1.5.0
>            Reporter: Jeff Storck
>            Assignee: Jeff Storck
>            Priority: Critical
>
> NiFi Processors currently have no means to relay whether or not they have may 
> be resource intensive or not. The idea here would be to introduce an 
> Annotation that can be added to Processors that indicate they may cause high 
> memory, disk, CPU, or network usage. For instance, any Processor that reads 
> the FlowFile contents into memory (like many XML Processors for instance) may 
> cause high memory usage. What ultimately determines if there is high 
> memory/disk/cpu/network usage will depend on the FlowFiles being processed. 
> With many of these components in the dataflow, it increases the risk of 
> OutOfMemoryErrors and performance degradation.
> The annotation should support one value from a fixed list of: CPU, Disk, 
> Memory, Network.  It should also allow the developer to provide a custom 
> description of the scenario that the component would fall under the high 
> usage category.  The annotation should be able to be specified multiple 
> times, for as many resources as it has the potential to be high usage.
> By marking components with this new Annotation, we can update the generated 
> Processor documentation to include this fact.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to