On Thu, Jul 03, 2014 at 07:18:56PM +0200, Nikola Knezevic wrote: > is there a way to abort a putBlob operation, making sure that the object > store will not create the blob?
jclouds does not support aborting putBlob, but you appear to have found a clever workaround below! jclouds 1.7.3 also does not support aborting getBlob but we are tracking this issue and a fix at: https://issues.apache.org/jira/browse/JCLOUDS-417 https://github.com/jclouds/jclouds/pull/435 > For example, if I'm issue a putBlob operation, where I generate the content > and pass it to the Blob through PipedInputStream/PipedOutputStream pair, > would it be possible to abort the operation if there is an exception in the > generation. I'm not sure would mere closing of a blob's stream prevent the > object store from creating the blob. If the input stream I pass to > blob.setPayload() throws an IOException, would that do the trick? This will work although you should provide the blobstore some cookie to know that the blob did not complete successfully, e.g., Content-length or Content-MD5. Further you should ensure that you use a non-repeatable Payload like an InputStream, specifically a PipedInputStream will work. jclouds should provide real support for aborting putBlob. Can you open a JIRA issue to track this? It intersects with some of our AsyncBlobStore discussion. -- Andrew Gaul http://gaul.org/
