flume-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flume] bessbd commented on a change in pull request #320: Fix issues reported by SpotBugs in ElasticSearch sink
Date Mon, 13 Apr 2020 20:32:18 GMT
bessbd commented on a change in pull request #320: Fix issues reported by SpotBugs in ElasticSearch
sink
URL: https://github.com/apache/flume/pull/320#discussion_r407703334
 
 

 ##########
 File path: flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/client/ElasticSearchRestClient.java
 ##########
 @@ -105,7 +105,7 @@ public void addEvent(Event event, IndexNameBuilder indexNameBuilder,
String inde
     parameters.put(INDEX_OPERATION_NAME, indexParameters);
 
     Gson gson = new Gson();
-    synchronized (bulkBuilder) {
 
 Review comment:
   Looking at this PR, all changes seem awesome to me, but this one (and the one after - same
`synchronized (this)`) seems to alter semantics. What do you think about going one step further
and making `bulkBuilder` a `StringBuffer` instead of a `StringBuilder` so that the thread-safety
of `StringBuffer` is leveraged?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message