-
Notifications
You must be signed in to change notification settings - Fork 242
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
Add open() API with FileStatus #1244
Add open() API with FileStatus #1244
Conversation
/gcbrun |
gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java
Show resolved
Hide resolved
gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java
Show resolved
Hide resolved
public FSDataInputStream open(FileStatus status) throws IOException { | ||
logger.atFine().log("openWithStatus(%s)", status); | ||
|
||
GoogleHadoopFileStatus fileStatus = (GoogleHadoopFileStatus) status; |
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.
Wouldn't it be casting issue?
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.
Caller will have to handle the exception.
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.
It would be better to validate and throw IllegalArgument instead of throwing type cast exception from API?
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.
Done
gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java
Show resolved
Hide resolved
gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem.java
Show resolved
Hide resolved
/gcbrun |
/gcbrun |
public FSDataInputStream open(FileStatus status) throws IOException { | ||
logger.atFine().log("openWithStatus(%s)", status); | ||
|
||
if (!GoogleHadoopFileStatus.class.isAssignableFrom(status.getClass())) { |
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.
isInstanceOf
would have sufficed, no?
7ad304c
into
GoogleCloudDataproc:branch-3.0.x
No description provided.