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

Pietro Cerutti edited comment on AVRO-2014 at 12/16/19 9:00 AM:
----------------------------------------------------------------

Hi - we are working to upgrade our codebase from 1.8 to 1.9, and we noticed 
that we also modified DataFileWriter to accept an OutputStream. However, our 
API takes the OutputStream by reference, instead of unique_ptr. Apart from 
being more consistent with, e.g., `Encoder::init(OutputStream& os)`, this is 
also a bit more useful. See the comment above: how do you get back the stream 
that was written to `out` if `out` is moved into `dfw`?

Can I suggest to at least add an alternative API to take the stream by ref, and 
possibly deprecate this one? I am willing to open a PR.

 

Edit: "see the comment above" -> 
https://github.com/apache/avro/pull/270#issuecomment-510967310


was (Author: pietro-cerutti):
Hi - we are working to upgrade our codebase from 1.8 to 1.9, and we noticed 
that we also modified DataFileWriter to accept an OutputStream. However, our 
API takes the OutputStream by reference, instead of unique_ptr. Apart from 
being more consistent with, e.g., `Encoder::init(OutputStream& os)`, this is 
also a bit more useful. See the comment above: how do you get back the stream 
that was written to `out` if `out` is moved into `dfw`?

Can I suggest to at least add an alternative API to take the stream by ref, and 
possibly deprecate this one? I am willing to open a PR.

> C++ DataFile support custom stream
> ----------------------------------
>
>                 Key: AVRO-2014
>                 URL: https://issues.apache.org/jira/browse/AVRO-2014
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: c++
>            Reporter: Zoyo Pei
>            Assignee: Thiruvalluvan M. G.
>            Priority: Major
>             Fix For: 1.9.0
>
>
> It is recommended that C++ DataFile support custom stream. E.g,
> DataFileWriter(OutputStream *stream, ...);
> So we can write into hdfs like this
> auto writer = new DataFileWriter<T>(new HDFSOutputStream(...), ...);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to