You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by GitBox <gi...@apache.org> on 2020/03/27 01:36:56 UTC

[GitHub] [flume] AndreLouisCaron commented on a change in pull request #320: Fix issues reported by SpotBugs in ElasticSearch sink

AndreLouisCaron 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_r398987831
 
 

 ##########
 File path: flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ElasticSearchDynamicSerializer.java
 ##########
 @@ -64,9 +64,10 @@ private void appendBody(XContentBuilder builder, Event event)
   private void appendHeaders(XContentBuilder builder, Event event)
       throws IOException {
     Map<String, String> headers = event.getHeaders();
-    for (String key : headers.keySet()) {
-      ContentBuilderUtil.appendField(builder, key,
-          headers.get(key).getBytes(charset));
+    for (Map.Entry<String,String> entry : headers.entrySet()) {
+      String key = entry.getKey();
+      byte[] val = entry.getValue().getBytes(charset);
 
 Review comment:
   Note to reviewers: SpotBugs was complaining about `WMI_WRONG_MAP_ITERATOR`.

----------------------------------------------------------------
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