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

Alexander Fedulov commented on FLINK-35240:
-------------------------------------------

[~gongzhongqiang] and [~robyoung]  you are right!

Unfortunately the docs of the {{FLUSH_PASSED_TO_STREAM}} are lying about it 
only being relevant for the {{flush}} method, whereas it indeed controls 
individual flushes from the {{close()}} method
{code:java}
/**
* Feature that specifies that calls to {@link #flush} will cause
* matching <code>flush()</code> to underlying {@link OutputStream}
* or {@link Writer}; if disabled this will not be done.
* Main reason to disable this feature is to prevent flushing at
* generator level, if it is not possible to prevent method being
* called by other code (like <code>ObjectMapper</code> or third
* party libraries).
*<p>
* Feature is enabled by default.
*/
FLUSH_PASSED_TO_STREAM(true){code}

> Disable FLUSH_AFTER_WRITE_VALUE to avoid flush per record
> ---------------------------------------------------------
>
>                 Key: FLINK-35240
>                 URL: https://issues.apache.org/jira/browse/FLINK-35240
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / FileSystem
>            Reporter: Zhongqiang Gong
>            Priority: Minor
>         Attachments: image-2024-04-26-00-23-29-975.png, 
> image-2024-04-26-17-16-07-925.png, image-2024-04-26-17-16-20-647.png, 
> image-2024-04-26-17-16-30-293.png, screenshot-1.png
>
>
> *Reproduce:*
> * According to user email: 
> https://lists.apache.org/thread/9j5z8hv4vjkd54dkzqy1ryyvm0l5rxhc
> *  !image-2024-04-26-00-23-29-975.png! 
> *Analysis:*
> * `org.apache.flink.formats.csv.CsvBulkWriter#addElement` will flush per 
> record.
> *Solution:*
> * I think maybe we can disable `FLUSH_AFTER_WRITE_VALUE` to avoid flush when 
> a record added.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to