'Constructor.
Args:
mapreduce_spec: mapreduce specification as model.MapreduceSpec.
shard_state: shard state as model.ShardState.'

def __init__(self, mapreduce_spec, shard_state):

    self.mapreduce_spec = mapreduce_spec
    self.shard_state = shard_state
    self.mutation_pool = MutationPool()
    self.counters = Counters(shard_state)
    self._pools = {}
    self.register_pool('mutation_pool', self.mutation_pool)
    self.register_pool('counters', self.counters)
