You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/07/19 12:28:00 UTC

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

     [ https://issues.apache.org/jira/browse/AVRO-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated AVRO-2282:
---------------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.4
>
>         Attachments: avrojsonencoder1.patch, avrojsonencoder1.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The [FLUSH_PASSED_TO_STREAM|https://github.com/codehaus/jackson/blob/1.8/src/java/org/codehaus/jackson/JsonGenerator.java#L120] feature of jackson's 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
(v8.20.10#820010)