From 083fc21aba4d02ba55937694005a9198c72c9450 Mon Sep 17 00:00:00 2001 From: Sydney Munro Date: Fri, 23 Jun 2023 14:46:11 -0700 Subject: [PATCH] Address PR comments --- .../ParallelDownloadConfig.java | 20 +++++++++++++++++-- .../transfermanager/ParallelUploadConfig.java | 20 +++++++++++++++++-- .../transfermanager/TransferManager.java | 6 ++++-- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelDownloadConfig.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelDownloadConfig.java index 620e0e33c..222dc9e36 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelDownloadConfig.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelDownloadConfig.java @@ -54,19 +54,29 @@ private ParallelDownloadConfig( /** * A common prefix removed from an object's name before being written to the filesystem. + * + * @see Builder#setStripPrefix(String) */ @BetaApi public @NonNull String getStripPrefix() { return stripPrefix; } - /** The base directory in which all objects will be placed when downloaded. */ + /** + * The base directory in which all objects will be placed when downloaded. + * + * @see Builder#setDownloadDirectory(Path) + */ @BetaApi public @NonNull Path getDownloadDirectory() { return downloadDirectory; } - /** The bucket objects are being downloaded from. */ + /** + * The bucket objects are being downloaded from. + * + * @see Builder#setBucketName(String) + */ @BetaApi public @NonNull String getBucketName() { return bucketName; @@ -75,6 +85,8 @@ private ParallelDownloadConfig( /** * A list of common BlobSourceOptions that are used for each download request. Note this list of * options will be applied to every single request. + * + * @see Builder#setOptionsPerRequest(List) */ @BetaApi public @NonNull List getOptionsPerRequest() { @@ -141,6 +153,7 @@ private Builder() { * names before they are written to the filesystem. * * @return the builder instance with the value for stripPrefix modified. + * @see ParallelDownloadConfig#getStripPrefix() */ @BetaApi public Builder setStripPrefix(String stripPrefix) { @@ -152,6 +165,7 @@ public Builder setStripPrefix(String stripPrefix) { * Sets the base directory on the filesystem that all objects will be written to. * * @return the builder instance with the value for downloadDirectory modified. + * @see ParallelDownloadConfig#getDownloadDirectory() */ @BetaApi public Builder setDownloadDirectory(Path downloadDirectory) { @@ -163,6 +177,7 @@ public Builder setDownloadDirectory(Path downloadDirectory) { * Sets the bucketName that Transfer Manager will download from. This field is required. * * @return the builder instance with the value for bucketName modified. + * @see ParallelDownloadConfig#getBucketName() */ @BetaApi public Builder setBucketName(String bucketName) { @@ -175,6 +190,7 @@ public Builder setBucketName(String bucketName) { * will be applied to every single download request. * * @return the builder instance with the value for OptionsPerRequest modified. + * @see ParallelDownloadConfig#getOptionsPerRequest() */ @BetaApi public Builder setOptionsPerRequest(List optionsPerRequest) { diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelUploadConfig.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelUploadConfig.java index d1f50b151..c71374f6d 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelUploadConfig.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/ParallelUploadConfig.java @@ -54,19 +54,29 @@ private ParallelUploadConfig( /** * If set Transfer Manager will skip uploading an object if it already exists, equivalent to * providing {@link BlobWriteOption#doesNotExist()} in {@link #getWriteOptsPerRequest()} + * + * @see Builder#setSkipIfExists(boolean) */ @BetaApi public boolean isSkipIfExists() { return skipIfExists; } - /** A common prefix that will be applied to all object paths in the destination bucket */ + /** + * A common prefix that will be applied to all object paths in the destination bucket + * + * @see Builder#setPrefix(String) + */ @BetaApi public @NonNull String getPrefix() { return prefix; } - /** The bucket objects are being uploaded from */ + /** + * The bucket objects are being uploaded from + * + * @see Builder#setBucketName(String) + */ @BetaApi public @NonNull String getBucketName() { return bucketName; @@ -75,6 +85,8 @@ public boolean isSkipIfExists() { /** * A list of common BlobWriteOptions, note these options will be applied to every single upload * request. + * + * @see Builder#setWriteOptsPerRequest(List) */ @BetaApi public @NonNull List getWriteOptsPerRequest() { @@ -149,6 +161,7 @@ private Builder() { * object if it already exists. * * @return the builder instance with the value for skipIfExists modified. + * @see ParallelUploadConfig#isSkipIfExists() */ @BetaApi public Builder setSkipIfExists(boolean skipIfExists) { @@ -160,6 +173,7 @@ public Builder setSkipIfExists(boolean skipIfExists) { * Sets a common prefix that will be applied to all object paths in the destination bucket. * * @return the builder instance with the value for prefix modified. + * @see ParallelUploadConfig#getPrefix() */ @BetaApi public Builder setPrefix(@NonNull String prefix) { @@ -171,6 +185,7 @@ public Builder setPrefix(@NonNull String prefix) { * Sets the bucketName that Transfer Manager will upload to. This field is required. * * @return the builder instance with the value for bucketName modified. + * @see ParallelUploadConfig#getBucketName() */ @BetaApi public Builder setBucketName(@NonNull String bucketName) { @@ -183,6 +198,7 @@ public Builder setBucketName(@NonNull String bucketName) { * will be applied to every single upload request. * * @return the builder instance with the value for WriteOptsPerRequest modified. + * @see ParallelUploadConfig#getWriteOptsPerRequest() */ @BetaApi public Builder setWriteOptsPerRequest(@NonNull List writeOptsPerRequest) { diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/TransferManager.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/TransferManager.java index a20453e1e..f333deca6 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/TransferManager.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/transfermanager/TransferManager.java @@ -31,7 +31,8 @@ public interface TransferManager extends AutoCloseable { /** - * Uploads a list of files in parallel. + * Uploads a list of files in parallel. This operation will not block the invoking thread, + * awaiting results should be done on the returned UploadJob. * *

Accepts a {@link ParallelUploadConfig} which defines the constraints of parallel uploads or * predefined defaults. @@ -60,7 +61,8 @@ public interface TransferManager extends AutoCloseable { UploadJob uploadFiles(List files, ParallelUploadConfig config); /** - * Downloads a list of blobs in parallel. + * Downloads a list of blobs in parallel. This operation will not block the invoking thread, + * awaiting results should be done on the returned DownloadJob. * *

Accepts a {@link ParallelDownloadConfig} which defines the constraints of parallel downloads * or predefined defaults.