Skip to content
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

Conversation

arunkumarchacko
Copy link
Contributor

No description provided.

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

public FSDataInputStream open(FileStatus status) throws IOException {
logger.atFine().log("openWithStatus(%s)", status);

GoogleHadoopFileStatus fileStatus = (GoogleHadoopFileStatus) status;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

public FSDataInputStream open(FileStatus status) throws IOException {
logger.atFine().log("openWithStatus(%s)", status);

if (!GoogleHadoopFileStatus.class.isAssignableFrom(status.getClass())) {
Copy link
Contributor

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?

@arunkumarchacko arunkumarchacko merged commit 7ad304c into GoogleCloudDataproc:branch-3.0.x Sep 9, 2024
3 of 4 checks passed
@arunkumarchacko arunkumarchacko deleted the open_with_status_3_0 branch September 9, 2024 08:08
arunkumarchacko added a commit to arunkumarchacko/hadoop-connectors that referenced this pull request Sep 9, 2024
arunkumarchacko added a commit to arunkumarchacko/hadoop-connectors that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants