Simple map-reduce implementation for Java