Skip to content

Conversation

@abeyad
Copy link

@abeyad abeyad commented May 5, 2016

This commit clarifies the behavior that must be adhered to by any implementors of the BlobContainer interface. This is done through expanded Javadocs.

Closes #15580

Copy link
Contributor

Choose a reason for hiding this comment

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

can you use expectThrows instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

(there seems to be a consensus around using expectThrows rather than this try/fail/catch/assert pattern for new tests)

@abeyad abeyad force-pushed the snapshot-repository-semantics branch from 8afed8a to 4a7e321 Compare May 5, 2016 19:14
@abeyad
Copy link
Author

abeyad commented May 5, 2016

@jpountz thank you for the feedback! I made the changes, and am catching IOExceptions now

@abeyad abeyad force-pushed the snapshot-repository-semantics branch from 4a7e321 to e7e3d4a Compare May 5, 2016 20:18
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth mentioning? This would be true for any Java code?

@jpountz
Copy link
Contributor

jpountz commented May 6, 2016

Thanks for improving it. I think @rmuir should have a look to confirm it fully addresses #15580.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not in favour of removing the blobSize information. It can be very useful for implementations to know in advance the size of the blob to be written. For example, the impl could decide to store small blobs differently from large ones... Some clients could also use this info when uploading the blob to a remote storage service like S3/Azure/GCS. Depending of the size of the blob, it can be uploaded in 1 request and large ones could be sent in multiple multi-part requests.

Also, this is required by the upcoming #13578.

Copy link
Author

Choose a reason for hiding this comment

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

@tlrx that's good to know, I didn't realize it was needed by the Google storage plugin. I'll add it back.

@abeyad abeyad force-pushed the snapshot-repository-semantics branch from e7e3d4a to dda8ea1 Compare May 6, 2016 14:45
@abeyad
Copy link
Author

abeyad commented May 23, 2016

@rmuir would you like to take a look at this PR with regards to #15580?

Copy link
Contributor

Choose a reason for hiding this comment

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

what if there is an error? should it just return false or throw an unchecked exception?

Copy link
Author

Choose a reason for hiding this comment

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

@rmuir good catch! I'm updating it to reflect that an IOException should be thrown if an error occurs while trying to ascertain the existence of the named blob.

@rmuir
Copy link
Contributor

rmuir commented May 23, 2016

Thanks for documenting this! It is much better. I added some questions for potential followup improvements of this stuff. But the contract is now way more clear: +1

@abeyad abeyad force-pushed the snapshot-repository-semantics branch from c6520fb to c3c5931 Compare May 23, 2016 22:15
@abeyad
Copy link
Author

abeyad commented May 23, 2016

@rmuir I've pushed a new commit c3c5931

Thank you for reviewing this!

Ali Beyad added 2 commits May 23, 2016 22:14
This commit clarifies the behavior that must be adhered to by any
implementors of the BlobContainer interface.  This is done through
expanded Javadocs.

Closes elastic#18157
Closes elastic#15580
@abeyad abeyad force-pushed the snapshot-repository-semantics branch from c3c5931 to 042ad83 Compare May 24, 2016 14:57
@abeyad
Copy link
Author

abeyad commented May 24, 2016

@rmuir I changed deleteBlob's javadocs to reflect that the contract is to throw an IOException if the blob does not exist, and this issue captures the various BlobContainer implementations that need to be fixed in order to conform: #18530

@abeyad
Copy link
Author

abeyad commented May 27, 2016

@rmuir do you think any other changes are required or is the PR in good shape now? (combined with the github issues created to address the outstanding issues)

@rmuir
Copy link
Contributor

rmuir commented May 31, 2016

sorry i missed your ping, I was +1 8 days ago for these changes! Thanks for opening followups

@abeyad
Copy link
Author

abeyad commented May 31, 2016

Thanks @rmuir and @jpountz for your reviews!

@abeyad abeyad closed this in 0efac76 May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement v5.0.0-alpha4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants