exceptionfactory commented on PR #8691: URL: https://github.com/apache/nifi/pull/8691#issuecomment-2146154785
> I've been looking through the codebase and I can't find any instances where OutputStream is used without either an OutputStreamCallback (and thus is seemingly incompatible with InputStreamCallback as used in SplitRecord) or a RecordWriter (which needs a schema and a controller service). Is writing a controller service required in order to follow this pattern, or is there an example of another approach somewhere I've missed? Writing a Controller Service is not required. The `StreamCallback` interface provides access to both an `InputStream` and `OutputStream`, which should support a stream-based solution without excessive buffering in memory. > > Also, in SplitRecord the 'splits' array is used to hold the data processed within the InputStreamCallback that splits the original record, but the individual 'split' records aren't returned by the callback (just appended to the 'splits' array whilst the callback is running). Does that mean that the callback itself is synchronous, or does something in OutputStream handle blocking to ensure there aren't issues with race conditions? The callback is synchronous, so `onTrigger()` and methods it calls must be implemented in a thread-safe manner. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
