Oleg Zhurakousky created NIFI-1680:
--------------------------------------

             Summary: Consider usage of direct buffers when splitting content 
stream
                 Key: NIFI-1680
                 URL: https://issues.apache.org/jira/browse/NIFI-1680
             Project: Apache NiFi
          Issue Type: Improvement
            Reporter: Oleg Zhurakousky
            Assignee: Oleg Zhurakousky


We have several use cases where a content of a single FlowFile is split within 
a single cycle (i.e., _onTrigger()_). An example is PutKafka.
Such splitting involves parsing of a content InputStream into chunks 
represented as byte[]. Currently we are using custom buffer 
(_org.apache.nifi.stream.io.ByteArrayOutputStream_) to build byte[]. 
There are several potential areas of improvement here:
1. For every cycle we are creating a new instance of _ByteArrayOutputStream_ 
which essentially reallocates the buffer used to build byte[].
2. The buffer itself is allocated on the heap
3. Similar to _ByteArrayOutputStream_, the _BufferedInputStream_ is also 
created for each cycle where with some customization it could be reused.




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

Reply via email to