App Engine Blobstore 一次下载所有 Blob
我想将所有 blob 作为单个压缩文件(或其他方式)下载到我的计算机上。无论如何要这样做吗?我使用Python SDK。
I would like to download all blobs as a single zipped file (or another way) to my computer. Anyway to do that? I use the python SDK.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不,没有办法做到这一点。 Blobstore 可以任意大,远大于单个文件中实际下载的大小。
No, there's no way to do this. The blobstore can be aribrarily large, far larger than is practical to download in a single file.
每个发送的网络请求的请求截止时间为 60 秒到GAE。 一个请求的响应不能超过 32 兆,其处理程序通常也不能使用使用默认配额超过 128 兆内存。
因此,假设,如果您有一个非常小的应用程序,也许您可以在内存中组装所有 blob 的 zip。但这是不可扩展的,如果你的 blostore 这么小,值得吗? (不,不是)。
底线是,GAE 中几乎没有什么是一次性完成的。您可以根据多个请求迭代地执行操作。
There is a request deadline of 60 seconds for each web request sent to GAE. One request cannot have a response larger than 32 megs, nor can its handler generally use more than 128 megs of memory using the default quotas.
So hypothetically, if you have a very small application, maybe you could assemble a zip in-memory of all your blobs. But that's not going to be scalable, and if your blostore is so small anyway, is it worth it? (No, it isn't).
Bottom line is, very little in GAE is done all-at-once. You do things iteratively, over multiple requests.
无论如何,一次下载一个可能会更好。这样,如果您的工作中途终止,您可以从失败的地方重新启动,而不是从头开始。
It's probably better to download them one at a time anyway. That way if your job dies part way through you can restart for where it failed rather than starting over again from scratch.
如何将 blob 复制到 Google 存储,然后使用 gsutil 从那里下载 blob?
How about copy the blobs to google storage and then use gsutil to download the blobs from there?