-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Cut over to Path API for file deletion #8366
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
Conversation
return true; | ||
} catch (Exception e) { | ||
return false; | ||
} |
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.
Seems weird to me to catch any Exception given that the method signature throws IOException?
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.
I agree will throw the exception
try { | ||
IOUtils.rm(FileSystemUtils.toPaths(nodeDatas)); | ||
} catch (Exception ex) { | ||
logger.debug("failed to remove node data locations", ex); |
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.
indentation
LGTM |
pushed another review round |
Today we use the File API for file deletion as well as recursive directory deletions. This API returns a boolean if operations are successful while hiding the actual reason why they failed. The Path API throws and actual exception that might provide better insights and debug information. Closes elastic#8366
ba2f077
to
95171e2
Compare
I marked it as breaking since I changed some interfaces internally |
Due to this change: elastic/elasticsearch#8366 Closes #44.
Today we use the File API for file deletion as well as recursive
directory deletions. This API returns a boolean if operations
are successful while hiding the actual reason why they failed.
The Path API throws and actual exception that might provide better
insights and debug information.