Backported #2349, thanks @Leperous
checkstyle cleanup
Pulled out constant
Merge pull request #2465 from noctarius/mapreduce-optimizations

Mapreduce optimizations