You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Michael Jiang <it...@gmail.com> on 2011/03/22 18:09:14 UTC

serialization to standard output?

New to avro. Want to get started by serializing some data to standard
output, so that it can be consumed by next tool down the pipeline. I think
this can be done but not sure what api to use in java (or python). Please
give some hints and references to look at. Thanks.

--mj

Re: serialization to standard output?

Posted by Michael Jiang <it...@gmail.com>.
Thanks, David, this looks like exactly what I want and helpful!

--mj

On Tue, Mar 22, 2011 at 11:48 AM, David Rosenstrauch <da...@darose.net>wrote:

> RTFM.  Look at the Javadoc for JsonEncoder:
> http://avro.apache.org/docs/current/api/java/org/apache/avro/io/JsonEncoder.html.  You provide it with an output stream for it to write the JSON output to.
>  That stream can be System.out, a file stream, a socket stream, etc.
>
> DR
>
>
> On 03/22/2011 01:36 PM, Michael Jiang wrote:
>
>> Thanks David, then what classes/apis to use to direct the json
>> formatted data to local stdout or a socket (so data can be sent over
>> network to a remote box) instead of a local disk file?
>>
>> --mj
>>
>> On Tue, Mar 22, 2011 at 10:11 AM, David
>> Rosenstrauch<da...@darose.net>wrote:
>>
>>  On 03/22/2011 01:09 PM, Michael Jiang wrote:
>>>
>>>  New to avro. Want to get started by serializing some data to
>>>> standard output, so that it can be consumed by next tool down the
>>>> pipeline. I think this can be done but not sure what api to use
>>>> in java (or python). Please give some hints and references to
>>>> look at. Thanks.
>>>>
>>>> --mj
>>>>
>>>>
>>> The JsonEncoder can encode Avro data to textual JSON format.
>>>
>>> HTH,
>>>
>>> DR
>>>
>>

Re: serialization to standard output?

Posted by David Rosenstrauch <da...@darose.net>.
RTFM.  Look at the Javadoc for JsonEncoder: 
http://avro.apache.org/docs/current/api/java/org/apache/avro/io/JsonEncoder.html 
.  You provide it with an output stream for it to write the JSON output 
to.  That stream can be System.out, a file stream, a socket stream, etc.

DR

On 03/22/2011 01:36 PM, Michael Jiang wrote:
> Thanks David, then what classes/apis to use to direct the json
> formatted data to local stdout or a socket (so data can be sent over
> network to a remote box) instead of a local disk file?
>
> --mj
>
> On Tue, Mar 22, 2011 at 10:11 AM, David
> Rosenstrauch<da...@darose.net>wrote:
>
>> On 03/22/2011 01:09 PM, Michael Jiang wrote:
>>
>>> New to avro. Want to get started by serializing some data to
>>> standard output, so that it can be consumed by next tool down the
>>> pipeline. I think this can be done but not sure what api to use
>>> in java (or python). Please give some hints and references to
>>> look at. Thanks.
>>>
>>> --mj
>>>
>>
>> The JsonEncoder can encode Avro data to textual JSON format.
>>
>> HTH,
>>
>> DR

Re: serialization to standard output?

Posted by Michael Jiang <it...@gmail.com>.
Thanks David, then what classes/apis to use to direct the json formatted
data to local stdout or a socket (so data can be sent over network to a
remote box) instead of a local disk file?

--mj

On Tue, Mar 22, 2011 at 10:11 AM, David Rosenstrauch <da...@darose.net>wrote:

> On 03/22/2011 01:09 PM, Michael Jiang wrote:
>
>> New to avro. Want to get started by serializing some data to standard
>> output, so that it can be consumed by next tool down the pipeline. I think
>> this can be done but not sure what api to use in java (or python). Please
>> give some hints and references to look at. Thanks.
>>
>> --mj
>>
>
> The JsonEncoder can encode Avro data to textual JSON format.
>
> HTH,
>
> DR
>

Re: serialization to standard output?

Posted by David Rosenstrauch <da...@darose.net>.
On 03/22/2011 01:09 PM, Michael Jiang wrote:
> New to avro. Want to get started by serializing some data to standard
> output, so that it can be consumed by next tool down the pipeline. I think
> this can be done but not sure what api to use in java (or python). Please
> give some hints and references to look at. Thanks.
>
> --mj

The JsonEncoder can encode Avro data to textual JSON format.

HTH,

DR