-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-5460][MLlib] Wrapped Try
around deleteAllCheckpoints
- RandomForest.
#4347
Conversation
Because `deleteAllCheckpoints` has IOException potential.
Can one of the admins verify this patch? |
@@ -244,7 +245,10 @@ private class RandomForest ( | |||
|
|||
// Delete any remaining checkpoints used for node Id cache. | |||
if (nodeIdCache.nonEmpty) { | |||
nodeIdCache.get.deleteAllCheckpoints() | |||
Try(nodeIdCache.get.deleteAllCheckpoints()) match { | |||
case Failure(e) => logWarning(s"delete all chackpoints faild. Error reason: ${e.getMessage}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a typo ("faild"). Are you sure you want to continue in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen
Thank you very much for indicating the typo.
Now, I modified typo and push again.
ok to test |
Test build #26767 has started for PR 4347 at commit
|
Test build #26767 has finished for PR 4347 at commit
|
Test FAILed. |
@@ -244,7 +245,10 @@ private class RandomForest ( | |||
|
|||
// Delete any remaining checkpoints used for node Id cache. | |||
if (nodeIdCache.nonEmpty) { | |||
nodeIdCache.get.deleteAllCheckpoints() | |||
Try(nodeIdCache.get.deleteAllCheckpoints()) match { | |||
case Failure(e) => logWarning(s"delete all chackpoints failed. Error reason: ${e.getMessage}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too wide. Move logWarning to the next line.
Btw, I don't see how Try
is useful here. Maybe we should just use
try {
...
} catch {
case ...
}
Java users would feel familiar with the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mengxr
Thank you ❗ and I see that.
So, change and push the code.
Test build #26832 has started for PR 4347 at commit
|
Test build #26832 has finished for PR 4347 at commit
|
Test FAILed. |
test this please |
Test build #26835 has started for PR 4347 at commit
|
Test build #26835 has finished for PR 4347 at commit
|
Test PASSed. |
…domForest. Because `deleteAllCheckpoints` has IOException potential. fix issue. Author: x1- <viva008@gmail.com> Closes #4347 from x1-/SPARK-5460 and squashes the following commits: 7a3d8de [x1-] change `Try()` to `try catch { case ... }` ar RandomForest. 3a52745 [x1-] modified typo. 'faild' -> 'failed' and remove disused '-'. 1572576 [x1-] Wrapped `Try` around `deleteAllCheckpoints` - RandomForest. (cherry picked from commit 62371ad) Signed-off-by: Xiangrui Meng <meng@databricks.com>
LGTM. Merged into master and branch-1.3. Thanks! |
@mengxr |
Because
deleteAllCheckpoints
has IOException potential.fix issue.