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

GORA-530 : Reinstated exception throwing in DataStore and Query #127

Merged
merged 2 commits into from Feb 27, 2018

Conversation

alfonsonishikawa
Copy link
Member

https://issues.apache.org/jira/browse/GORA-530

This pull request reinstates exceptions throwing in DataStore and Query.
I updated it to throw GoraException at several methods.
Updated tests because I found little inconsistencies after starting throwing exceptions (tests failing).

Please, review the datastores and comment anything you see along, because I made the changes and tests pass but I only know HBaseStore. It has been a pain to change all this in a bulk 📦

Thanks!

@renato2099
Copy link
Contributor

@alfonsonishikawa Thanks for doing this!

@alfonsonishikawa
Copy link
Member Author

Updated the pull request with a fix for a little bug I introduced. AccumuloStore#deleteSchema() was failing when the table did not exist. Not does not fail.

Thanks in advance for reviewing the datastore/s you know :)

}
return createPersistentInstance(record, fields);
} catch (GoraException e) {
throw e;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi,
Is there any specific reason why we are capturing the GoraException separately?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi! Yes. Notice that createPersistentInstance() has been updated to throw GoraException. Throughout this diff, GoraException is being used as a simple wrapper to have a common interface for all datastores, so as you can see two lines bellow in this diff, any exception (not GoraException) is logged and wrapped. In the case of a catch of a GoraException we can safely assume that it is already logged and wrapping other exception (or maybe an actual GoraException but this does not make difference) and we wouldn't want to wrap it again because that would be useless and would hide the exception's parent exception in an indefinite sequence.
Maybe it is not the best solution, but I didn't get to any better. If you have any suggestion it will be welcome!

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi, Nishadi.
I have been thinking about this. You asked because in the case the is only a log and a throw? I actually just enclosed with try-catch whatever existed before without thinking much about it. But if you are saying that we should only throw the exceptions without logging -since we are not logging anything interesting-, then I guess you are right. I could have done that, but I just did not want to change much the existing datastores :P My fault. It would be good just throw the exceptions and nothing more.
I will see about changing it whenever I have the time and energy :) Or if anyone wants to change it...

Thanks!

@lewismc
Copy link
Member

lewismc commented Feb 26, 2018

I @alfonsonishikawa I think we should go ahead and merge this into master branch. It been sitting for long enough. +1

@asfgit asfgit merged commit 73db597 into apache:master Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants