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

Rion Williams commented on FLINK-20979:
---------------------------------------

Hey [~jark],

I can see the coalescing behavior that you are referring to in the following 
section in the ElasticsearchConfiguration class:


{code:java}
public int getBulkFlushMaxActions() {        
    int maxActions = 
config.get(ElasticsearchOptions.BULK_FLUSH_MAX_ACTIONS_OPTION);        
    // convert 0 to -1, because Elasticsearch client use -1 to disable this 
configuration.        
    return maxActions == 0 ? -1 : maxActions;    
}
{code}
However, I noticed in the setter for this same property within the 
ElasticsearchSink itself, it appears that a 0 value would be considered invalid 
according to the existing Precondition:
{code:java}
public void setBulkFlushMaxActions(int numMaxActions) {            
    Preconditions.checkArgument(                    
            numMaxActions == -1 || numMaxActions > 0,                    
            "Max number of buffered actions must be larger than 0.");

    this.bulkRequestsConfig.put(                    
            CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS, String.valueOf(numMaxActions));  
      
}
{code}
The latter code was the first one that I originally had seen, so I could 
understand the confusion from a user's perspective. 

I'll leave it to you folks to decide what the best course of action to take. 
Just saw this an an opportunity to pick some low-hanging fruit as an initial 
commit to the project.




 

> Wrong description of 'sink.bulk-flush.max-actions'
> --------------------------------------------------
>
>                 Key: FLINK-20979
>                 URL: https://issues.apache.org/jira/browse/FLINK-20979
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / ElasticSearch, Documentation, Table SQL / 
> Ecosystem
>    Affects Versions: 1.12.0
>            Reporter: Dawid Wysakowicz
>            Priority: Major
>              Labels: pull-request-available, starter
>             Fix For: 1.13.0, 1.12.3
>
>
> The documentation claims the option can be disabled with '0', but it can 
> actually be disable with '-1' whereas '0' is an illegal value.
> {{Maximum number of buffered actions per bulk request. Can be set to '0' to 
> disable it. }}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to