the core: smap and sreduce