You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2019/02/01 07:04:14 UTC
[jclouds-site] branch master updated: Recommend use of repeatable
payloads
This is an automated email from the ASF dual-hosted git repository.
gaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds-site.git
The following commit(s) were added to refs/heads/master by this push:
new e291544 Recommend use of repeatable payloads
e291544 is described below
commit e29154414f68407a82691c97c1435f65299de146
Author: hisnamewasjaan <hi...@gmail.com>
AuthorDate: Thu Jan 31 18:46:46 2019 +0100
Recommend use of repeatable payloads
Added extra info from @nacx recommending the use of repeatable payloads.
Removed some deprecated and non-existing api from description,
---
start/blobstore.md | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/start/blobstore.md b/start/blobstore.md
index 719d339..de51156 100644
--- a/start/blobstore.md
+++ b/start/blobstore.md
@@ -392,10 +392,13 @@ an object from a container that does not exist is a state problem, and should th
<!--update to use ByteSource -->
### Uploading
-As long as you use either `InputStream` or `File` as the payload for your blob, you should
+As long as you use either `ByteSource` or `File` as the payload for your blob, you should
be fine. Note that in S3, you must calculate the length ahead of time, since it doesn't support
chunked encoding.
+It is usually better to use a repeatable payload like `ByteSource` instead of `InputStream`,
+since this allows parallel uploads and retrying on errors.
+
Our integration tests ensure that we don't rebuffer in memory on upload:
[testUploadBigFile](http://github.com/jclouds/jclouds/blob/master/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java).
@@ -405,5 +408,5 @@ environments such as Google App Engine.
### Downloading
A blob you've downloaded via `blobstore.getBlob()` can be accessed via
-`blob.getPayload().getInput()` or `blob.getPayload().writeTo(outputStream)`. Since these are
-streaming, you shouldn't have a problem with memory unless you rebuffer the payload.
+`blob.getPayload().openStream()`. Since this is streaming, you shouldn't have a problem
+with memory unless you rebuffer the payload.