You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Saurabh (JIRA)" <ji...@apache.org> on 2018/12/07 21:18:00 UTC

[jira] [Created] (AVRO-2282) Control default FLUSH_PASSED_TO_STREAM behavior of JsonEncoder

Saurabh created AVRO-2282:
-----------------------------

             Summary: Control default FLUSH_PASSED_TO_STREAM behavior of JsonEncoder
                 Key: AVRO-2282
                 URL: https://issues.apache.org/jira/browse/AVRO-2282
             Project: Apache Avro
          Issue Type: Improvement
          Components: java
            Reporter: Saurabh
             Fix For: 1.7.4
         Attachments: avrojsonencoder1.patch

The FLUSH_PASSED_TO_STREAM feature of JSONGenerator controls if flush calls to JsonEncoder are passed to the underlying stream. The default value for this is true causing the underlying stream to be flushed every time encoder.flush is called. Currently, JsonEncoder doesn't provide a way to change this behaviour. In many scenarios, a flush call is made to the encoder with the intention of flushing the buffer to the underlying stream, and not the stream itself, which has a detrimental impact on performance. The patch provided creates a way to specify the default behaviour of underlying JSONGenerator during JsonEncoder's initialization itself. This will be extremely helpful in scenarios such as Hadoop's MR Evenwriter, allowing the caller to set the desired behaviour for optimal performance. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)