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

Implement support for Azure blob storage. #167

Closed
wants to merge 1 commit into from

Conversation

jimmarino
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@holachuy holachuy left a comment

Choose a reason for hiding this comment

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

Very nice!

throw new UnsupportedOperationException("Not yet implemented");
try {
CloudBlobContainer container = blobClient.getContainerReference(jobId.toString());
container.createIfNotExists();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this throw an IOException if a job already exists with the current ID? that is consistent with the docs for createJob(UUID jobId, PortabilityJob job) as well as GoogleJobStore's impl

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hate to bring this up but has the discussion of checked vs. unchecked exceptions come up? (ducking) :-)

I would argue for unchecked exceptions except in cases where it is absolutely necessary to signal a condition is recoverable. Runtime exceptions can bubble up to the top of the stack where they can be trapped and logged. In the case of a duplicate ID, it seems like an unrecoverable programming error.

What do think?

I'm fine with using checked exceptions if that is what the project standard is as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

No that's a great point! I don't think we had talked about it. That convention sounds reasonable to me and looks to be the recommendation in Effective Java.

For now do you want to make it throw an IOException just to be consistent, but leave a TODO/issue to follow up on our convention project-wide?

Or if you want to make it throw an unchecked exception, and change the other create() method to do the same, that's fine with me too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I looked at changing the method (and others on the interface) to throw an IOException (or unchecked exception) but that change will impact other classes that use it (e.g. the MS importers and exporters for calendars and contacts) which is probably too much to put in this PR.

I'll raise this as an issue on Slack for people to discuss since others may have opinions. Based on that, I can create another PR to migrate the codebase to whatever approach is decided. In the meantime, I'll file an issue to track as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK thanks, that sounds good. Could you also either throw an unchecked exception in that place now, since it shouldn't impact other classes, or leave a TODO to throw when the job already exists, just so we don't forget? Thanks!

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.

None yet

3 participants