简体   繁体   English

谷歌云存储并行上传java

[英]Google cloud storage parallel upload java

I have some big files that I want to upload to cloud storage. 我有一些大文件要上传到云存储。 I want to use parallel upload to save time. 我想使用并行上传来节省时间。 I found this lib: gsutil but I can't find any java example or usage only for python. 我找到了这个lib:gsutil,但找不到任何Java示例或仅用于python的用法。

gsutil is not distributed as a library, only as a command-line tool. gsutil不作为库分发,而仅作为命令行工具分发。 I don't know of a Java library that supports parallel uploads, though that doesn't mean there isn't one. 我不知道一个支持并行上传的Java库,尽管这并不意味着没有。 However, you could do parallel writes by using the Compose operation, using the JSON or XML API for Google Cloud Storage. 但是,您可以使用Compose操作(针对Google Cloud Storage的JSON或XML API)进行并行写入。 Specifically, you would write a number of smaller objects in parallel and then (once all of those objects have been written) call the Compose request to compose them into one larger object. 具体来说,您将并行编写许多较小的对象,然后(一旦所有这些对象都被写入)调用Compose请求将它们组合成一个较大的对象。 If you're using the JSON API the compose documentation is at https://cloud.google.com/storage/docs/json_api/v1/objects/compose If you're using the XML API the compose documentation is at https://cloud.google.com/storage/docs/reference-methods#putobject (see the compose query parameter). 如果您使用JSON API,则撰写文档位于https://cloud.google.com/storage/docs/json_api/v1/objects/compose;如果您使用的是XML API,则撰写文档位于https:// /cloud.google.com/storage/docs/reference-methods#putobject (请参阅compose查询参数)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM