def flush(self):
    for pool in self._pools.values():
      pool.flush()
    if self.shard_state:
      self.shard_state.put()

  # TODO(user): Add convenience method for mapper params.

  # TODO(user): Add fatal error logging method here. Will log the message
  # and set the shard state to failure result status, which the controller
  # callback should pick up and force all shards to terminate.
Flush all information recorded in context.
dataset/ETHPy150Open livid/v2ex/mapreduce/context.py/Context.flush