Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Add AVRO_BUFFERING feature (enabled by default/existing behavior) #21

Closed
oakad opened this issue Aug 13, 2015 · 1 comment
Closed

Add AVRO_BUFFERING feature (enabled by default/existing behavior) #21

oakad opened this issue Aug 13, 2015 · 1 comment
Milestone

Comments

@oakad
Copy link
Contributor

oakad commented Aug 13, 2015

From the looking at AvroSchema class, I gather that the avro encoder/decoder is always obtained through call to "binaryEncoder()"/"binaryDecoder()" factory methods which returns buffered coders.

In many cases the buffering behavior of default AVRO coders is strongly undesirable. In particular, in many cases avro data may be followed by non-avro data in the underlying protocol (such as HTTP multipart/form-data) and thus the decoder must not advance the input stream more than absolutely necessary per schema definitions. When encoders are concerned , buffering may be outright redundant, as underlying output stream may already be buffered by down the line processor.

Avro library provides a non-buffering implementation of its coders ("directBinaryEncoder()"/"directBinaryDecoder()") for this exact use case. Can the jackson avro format handler be updated to enable use of those direct coders (per configuration setting or somehow else)?

@cowtowncoder
Copy link
Member

We are open to suggestion on improvements, for example in form of Pull requests.

One possible way to support this would be to add new AvroParser.Feature and AvroGenerator.Feature constants, and use those to determine which encoder/decoder to construct.
That should be quite easy to do.

@cowtowncoder cowtowncoder changed the title Support for directBinaryEncoder/Decoder Add AVRO_BUFFERING feature (enabled by default/existing behavior) Aug 17, 2015
@cowtowncoder cowtowncoder added this to the 2.7.0 milestone Aug 17, 2015
cowtowncoder added a commit that referenced this issue Aug 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants