Add mapreducesample with finalize.