我正在使用 Google Cloud Storage 和 Java,我需要批量上传 1000 个对象到 GCS。
这是GCS提供的文档
Storage storage = StorageOptions.getDefaultInstance().getService();
BlobId blobId = BlobId.of("bucket", "blob_name");
BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
Blob blob = storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
但它只适用于一个对象,我一直在寻找批处理函数,但没有找到它,因此我必须使用 for 逐个对象上传。
最佳答案
目前还没有。您可以在此处了解现有积压的功能请求:https://github.com/googleapis/google-cloud-java/issues/2351
关于java - 如何在 Google Cloud Storage 中批量上传对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57318258/