-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-18450. JavaKeyStoreProvider should throw FileNotFoundException… #5452
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
base: trunk
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
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.
Left a minor comment, looks good otherwise
if (!fs.exists(src)) { | ||
throw new FileNotFoundException(src.toUri().toString()); | ||
} |
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.
How about keeping this check just before fs#rename
? Could save efforts of doing rename in the first place?
💔 -1 overall
This message was automatically generated. |
… in renameOrFail
Description of PR
Attempting to create a key a KMS is configured with the JavaKeystoreProvider and an HDFS store. The calls to:
... fails with an IOException when it attempts to rename a file. The calling code catches FileNotFoundException since the src file may not exist.
Example:
Update the implementation to check for the file, throwing a FileNotFoundException.
How was this patch tested?
Running in an Hadoop development environment docker image.
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?