Class BlobWriteSessionConfigs

java.lang.Object
com.google.cloud.storage.BlobWriteSessionConfigs

@BetaApi public final class BlobWriteSessionConfigs extends Object
Factory class to select and construct BlobWriteSessionConfigs.

There are several strategies which can be used to upload a Blob to Google Cloud Storage. This class provides factories which allow you to select the appropriate strategy for your workload.

Comparison of Strategies
Strategy Factory Method(s) Description Retry Support Transports Supported Cloud Storage API used Considerations
Default (Chunk based upload) getDefault() Buffer up to a configurable amount of bytes in memory, write to Cloud Storage when full or close. Buffer size is configurable via DefaultBlobWriteSessionConfig.withChunkSize(int) Each chunk is retried up to the limitations specified in ServiceOptions.getRetrySettings() gRPC Resumable Upload The network will only be used for the following operations:
  1. Creating the Resumable Upload Session
  2. Transmitting zero or more incremental chunks
  3. Transmitting the final chunk and finalizing the Resumable Upload Session
  4. If any of the above are interrupted with a retryable error, the Resumable Upload Session will be queried to reconcile client side state with Cloud Storage
Buffer to disk then upload Buffer bytes to a temporary file on disk. On close() upload the entire files contents to Cloud Storage. Delete the temporary file. Upload the file in the fewest number of RPC possible retrying within the limitations specified in ServiceOptions.getRetrySettings() gRPC Resumable Upload
  1. A Resumable Upload Session will be used to upload the file on disk.
  2. If the upload is interrupted with a retryable error, the Resumable Upload Session will be queried to restart the upload from Cloud Storage's last received byte
Journal to disk while uploading journaling(Collection<Path>) Create a Resumable Upload Session, before transmitting bytes to Cloud Storage write to a recovery file on disk. If the stream to Cloud Storage is interrupted with a retryable error query the offset of the Resumable Upload Session, then open the recovery file from the offset and transmit the bytes to Cloud Storage. gRPC Resumable Upload
  1. The stream to Cloud Storage will be held open until a) the write is complete b) the stream is interrupted
  2. Because the bytes are journaled to disk, the upload to Cloud Storage can only be as fast as the disk.
  3. The use of Compute Engine Local NVMe SSD is strongly encouraged compared to Compute Engine Persistent Disk.
Since:
2.26.0 This new api is in preview and is subject to breaking changes.
See Also: