Fix issues reported by SpotBugs in ElasticSearch sink
I'm working on some minor contributions to the ElasticSearch sink and I noticed that mvn install -pl flume-ng-sinks/flume-ng-elasticsearch-sink fails out of the box due to issues reported by SpotBugs.
In this pull request, I am fixing said issues to keep future diffs clean when contributing changes.
Hi @AndreLouisCaron ,
Thank you for the PRs! I've managed to skim through them and they look like valuable changes! Unfortunately, the build is broken and I don't think I have enough time to fix it nowadays. Would you be interested in looking into that? If you'd need any support, please don't hesitate to let me know.
@bessbd I took a quick look. I'm not familiar with Java and the ecosystem in this project, but it looks to me like some kind of static code analysis tool is reporting too many errors in code generated by the Thrift compiler.
I tried manually fixing the code in #324. The solution is clearly less than optimal, but I'm not sure how to do it properly. Let's continue that discussion over there.
@bessbd Now that the build is fixed, I rebased this onto the latest trunk to get a clean build :-)
Before merging, I will also set the spotbugs.maxAllowedViolations property to 0.
@bessbd @mpercy I rebased this and set spotbugs.maxAllowedViolations=0.
I have some more changes to fix PMD violations as well. Do you want those in a new commit on the same PR or should I open a new one for those changes?
Support for Elasticsearch has been removed from the main Flume build since it is so out of date and its new license is problematic. Please work against the flume-search repo.