Martin Zink created MINIFICPP-1644:
--------------------------------------
Summary: ProcessSession::read ignores the size/offset of the
flowfile
Key: MINIFICPP-1644
URL: https://issues.apache.org/jira/browse/MINIFICPP-1644
Project: Apache NiFi MiNiFi C++
Issue Type: Improvement
Reporter: Martin Zink
Assignee: Martin Zink
The ProcessSession::read will read until the resource claims size, not the
flowfiles size.
If the flowfiles size/offset doesnt match the size/offset of its resource
claim, this could cause problems. One way this could happend is using the
_ProcessSession::clone(const std::shared_ptr<core::FlowFile> &parent, int64_t
offset, int64_t size)_
The behaviour is also dependant on the type of ContentRepository
e.g.
using FileSystemContentRepository or VolatileContentRepository
{code:java}
auto first_half_clone = session->clone(original_ff, 0,
original_ff->getSize()/2);
auto second_half_clone = session->clone(original_ff, original_ff->getSize()/2,
original_ff->getSize()/2);
session->read(original_ff, reader); // Reads foobar
session->read(first_half_clone, reader); // Reads foobar
session->read(second_half_clone, reader); // Reads bar
{code}
using DatabaseContentRepository
{code:java}
auto first_half_clone = session->clone(original_ff, 0,
original_ff->getSize()/2);
auto second_half_clone = session->clone(original_ff, original_ff->getSize()/2,
original_ff->getSize()/2);
session->read(original_ff, reader); // Reads foobar
session->read(first_half_clone, reader); // Reads foobar
session->read(second_half_clone, reader); // Reads foobar{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)