write and read generation in ResultTask
Merge pull request #757 from BlackNiuza/result_task_generation

Bug fix: SPARK-837