GitHub user jaceklaskowski opened a pull request: https://github.com/apache/spark/pull/10433
[CORE] Refactoring: Use pattern matching and dedicated method It should be slightly easier to see what really happens (without questions like what other state a task can be here). BTW, I was thinking about introducing `TaskState.isFailed` or similar method so it's even clearer that the order of cases in the pattern match matters as the only case left out in `TaskState.isFinished` is `FINISHED`. With such a method, `TaskState.isFinished` would be `TaskState.isFailed` + `FINISHED` state. Perhaps, `TaskState.isCompleted` would be more appropriate. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jaceklaskowski/spark taskschedulerimpl-pattern-matching Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/10433.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #10433 ---- commit 734095269660da9b6db454ebe49466ffd5cd1b04 Author: Jacek Laskowski <ja...@japila.pl> Date: 2015-12-22T13:14:05Z [CORE] Refactoring: Use pattern matching and dedicated method ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org