#NEWLINE# @ classmethod #NEWLINE# def commit_output( cls , shard_ctx , iterator ) : #NEWLINE# #INDENT# 'Saves output references when a shard finishes.\n\n    Inside end_shard(), an output writer can optionally use this method\n    to persist some references to the outputs from this shard\n    (e.g a list of filenames)\n\n    Args:\n      shard_ctx: map_job_context.ShardContext for this shard.\n      iterator: an iterator that yields json serializable\n        references to the outputs from this shard.\n        Contents from the iterator can be accessible later via\n        map_job.Job.get_outputs.\n    ' #NEWLINE# outs = tuple ( iterator ) #NEWLINE# shard_ctx . _state . writer_state [ 'outs' ] = outs