simple mapreduce implementation in java