Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-munro committed Apr 11, 2024
1 parent a7eb3b5 commit b9f0c70
Showing 1 changed file with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.BlobInfo;
import com.google.cloud.storage.BlobWriteSessionConfigs;
import com.google.cloud.storage.GrpcStorageOptions;
import com.google.cloud.storage.HttpStorageOptions;
import com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig;
import com.google.cloud.storage.ParallelCompositeUploadBlobWriteSessionConfig.ExecutorSupplier;
import com.google.cloud.storage.Storage;
Expand Down Expand Up @@ -82,23 +80,11 @@ final class TransferManagerImpl implements TransferManager {
.build();
}
// Create the blobWriteSessionConfig for ParallelCompositeUpload
ParallelCompositeUploadBlobWriteSessionConfig pcuConfig =
BlobWriteSessionConfigs.parallelCompositeUpload()
.withExecutorSupplier(ExecutorSupplier.useExecutor(executor));
if (storageOptions instanceof GrpcStorageOptions
&& transferManagerConfig.isAllowParallelCompositeUpload()) {
storageOptions =
((GrpcStorageOptions) storageOptions)
.toBuilder()
.setBlobWriteSessionConfig(pcuConfig)
.build();
} else if (storageOptions instanceof HttpStorageOptions
&& transferManagerConfig.isAllowParallelCompositeUpload()) {
storageOptions =
((HttpStorageOptions) storageOptions)
.toBuilder()
.setBlobWriteSessionConfig(pcuConfig)
.build();
if (transferManagerConfig.isAllowParallelCompositeUpload()) {
ParallelCompositeUploadBlobWriteSessionConfig pcuConfig =
BlobWriteSessionConfigs.parallelCompositeUpload()
.withExecutorSupplier(ExecutorSupplier.useExecutor(executor));
storageOptions = storageOptions.toBuilder().setBlobWriteSessionConfig(pcuConfig).build();
}
pcuQueue = new ArrayDeque<>();
this.storage = storageOptions.getService();
Expand Down

0 comments on commit b9f0c70

Please sign in to comment.