Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove @BetaApi Annotations for Transfer Manager operations #2529

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.rpc.ApiExceptions;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
Expand All @@ -34,7 +33,6 @@
*
* @see Builder
*/
@BetaApi
public final class DownloadJob {

@NonNull private final List<ApiFuture<DownloadResult>> downloadResults;
Expand All @@ -55,7 +53,6 @@ private DownloadJob(
*
* @see Builder#setDownloadResults(List)
*/
@BetaApi
public @NonNull List<DownloadResult> getDownloadResults() {
return ApiExceptions.callAndTranslateApiException(ApiFutures.allAsList(downloadResults));
}
Expand All @@ -65,7 +62,6 @@ private DownloadJob(
*
* @see Builder#setParallelDownloadConfig(ParallelDownloadConfig)
*/
@BetaApi
public @NonNull ParallelDownloadConfig getParallelDownloadConfig() {
return parallelDownloadConfig;
}
Expand Down Expand Up @@ -96,7 +92,6 @@ public String toString() {
.toString();
}

@BetaApi
public static Builder newBuilder() {
return new Builder();
}
Expand All @@ -106,7 +101,6 @@ public static Builder newBuilder() {
*
* @see DownloadJob
*/
@BetaApi
public static final class Builder {

private @NonNull List<ApiFuture<DownloadResult>> downloadResults;
Expand All @@ -122,7 +116,6 @@ private Builder() {
* @return the instance of the Builder with DownloadResults modified.
* @see DownloadJob#getDownloadResults()
*/
@BetaApi
public Builder setDownloadResults(@NonNull List<ApiFuture<DownloadResult>> downloadResults) {
this.downloadResults = ImmutableList.copyOf(downloadResults);
return this;
Expand All @@ -134,7 +127,6 @@ public Builder setDownloadResults(@NonNull List<ApiFuture<DownloadResult>> downl
* @return the instance of the Builder with ParallelDownloadConfig modified.
* @see DownloadJob#getParallelDownloadConfig()
*/
@BetaApi
public Builder setParallelDownloadConfig(
@NonNull ParallelDownloadConfig parallelDownloadConfig) {
this.parallelDownloadConfig = parallelDownloadConfig;
Expand All @@ -146,7 +138,6 @@ public Builder setParallelDownloadConfig(
*
* @return {@link DownloadJob}
*/
@BetaApi
public DownloadJob build() {
checkNotNull(downloadResults);
checkNotNull(parallelDownloadConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

import com.google.api.core.BetaApi;
import com.google.cloud.storage.BlobInfo;
import com.google.common.base.MoreObjects;
import java.nio.file.Path;
Expand All @@ -33,7 +32,6 @@
*
* @see Builder
*/
@BetaApi
public final class DownloadResult {
static final Comparator<DownloadResult> COMPARATOR =
Comparator.comparingInt(dr -> dr.getStatus().ordinal());
Expand All @@ -59,7 +57,6 @@ private DownloadResult(
*
* @see Builder#setInput(BlobInfo)
*/
@BetaApi
public @NonNull BlobInfo getInput() {
return input;
}
Expand All @@ -70,7 +67,6 @@ private DownloadResult(
*
* @see Builder#setOutputDestination(Path)
*/
@BetaApi
public @NonNull Path getOutputDestination() {
checkState(
status == TransferStatus.SUCCESS,
Expand All @@ -85,7 +81,6 @@ private DownloadResult(
* @see TransferStatus
* @see Builder#setStatus(TransferStatus)
*/
@BetaApi
public @NonNull TransferStatus getStatus() {
return status;
}
Expand All @@ -97,7 +92,6 @@ private DownloadResult(
*
* @see Builder#setException(Exception)
*/
@BetaApi
public @NonNull Exception getException() {
checkState(
status == TransferStatus.FAILED_TO_FINISH || status == TransferStatus.FAILED_TO_START,
Expand Down Expand Up @@ -136,7 +130,6 @@ public String toString() {
.toString();
}

@BetaApi
public static Builder newBuilder(@NonNull BlobInfo blobInfo, @NonNull TransferStatus status) {
return new Builder(blobInfo, status);
}
Expand All @@ -146,7 +139,6 @@ public static Builder newBuilder(@NonNull BlobInfo blobInfo, @NonNull TransferSt
*
* @see DownloadResult
*/
@BetaApi
public static final class Builder {

private @NonNull BlobInfo input;
Expand All @@ -165,7 +157,6 @@ private Builder(@NonNull BlobInfo input, @NonNull TransferStatus status) {
* @see DownloadResult#getInput()
* @return the instance of the Builder with the value for input modified.
*/
@BetaApi
public Builder setInput(@NonNull BlobInfo input) {
this.input = input;
return this;
Expand All @@ -178,7 +169,6 @@ public Builder setInput(@NonNull BlobInfo input) {
* @see DownloadResult#getOutputDestination()
* @return the instance of the Builder with the value for outputDestination modified.
*/
@BetaApi
public Builder setOutputDestination(@NonNull Path outputDestination) {
this.outputDestination = outputDestination;
return this;
Expand All @@ -190,7 +180,6 @@ public Builder setOutputDestination(@NonNull Path outputDestination) {
* @see TransferStatus
* @return the instance of the Builder with the value for status modified.
*/
@BetaApi
public Builder setStatus(@NonNull TransferStatus status) {
this.status = status;
return this;
Expand All @@ -204,7 +193,6 @@ public Builder setStatus(@NonNull TransferStatus status) {
* @see DownloadResult#getException()
* @return the instance of the Builder with the value for exception modified.
*/
@BetaApi
public Builder setException(@NonNull Exception exception) {
this.exception = exception;
return this;
Expand All @@ -215,7 +203,6 @@ public Builder setException(@NonNull Exception exception) {
*
* @return {@link DownloadResult}
*/
@BetaApi
public DownloadResult build() {
checkNotNull(input);
checkNotNull(status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.api.core.BetaApi;
import com.google.cloud.storage.Storage.BlobSourceOption;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
Expand All @@ -33,7 +32,6 @@
*
* @see Builder
*/
@BetaApi
public final class ParallelDownloadConfig {

@NonNull private final String stripPrefix;
Expand All @@ -57,7 +55,6 @@ private ParallelDownloadConfig(
*
* @see Builder#setStripPrefix(String)
*/
@BetaApi
public @NonNull String getStripPrefix() {
return stripPrefix;
}
Expand All @@ -67,7 +64,6 @@ private ParallelDownloadConfig(
*
* @see Builder#setDownloadDirectory(Path)
*/
@BetaApi
public @NonNull Path getDownloadDirectory() {
return downloadDirectory;
}
Expand All @@ -77,7 +73,6 @@ private ParallelDownloadConfig(
*
* @see Builder#setBucketName(String)
*/
@BetaApi
public @NonNull String getBucketName() {
return bucketName;
}
Expand All @@ -88,7 +83,6 @@ private ParallelDownloadConfig(
*
* @see Builder#setOptionsPerRequest(List)
*/
@BetaApi
public @NonNull List<BlobSourceOption> getOptionsPerRequest() {
return optionsPerRequest;
}
Expand Down Expand Up @@ -128,12 +122,10 @@ public String toString() {
*
* @see ParallelDownloadConfig
*/
@BetaApi
public static Builder newBuilder() {
return new Builder();
}

@BetaApi
public static final class Builder {

@NonNull private String stripPrefix;
Expand All @@ -155,7 +147,6 @@ private Builder() {
* @return the builder instance with the value for stripPrefix modified.
* @see ParallelDownloadConfig#getStripPrefix()
*/
@BetaApi
public Builder setStripPrefix(String stripPrefix) {
this.stripPrefix = stripPrefix;
return this;
Expand All @@ -167,7 +158,6 @@ public Builder setStripPrefix(String stripPrefix) {
* @return the builder instance with the value for downloadDirectory modified.
* @see ParallelDownloadConfig#getDownloadDirectory()
*/
@BetaApi
public Builder setDownloadDirectory(Path downloadDirectory) {
this.downloadDirectory = downloadDirectory;
return this;
Expand All @@ -179,7 +169,6 @@ public Builder setDownloadDirectory(Path downloadDirectory) {
* @return the builder instance with the value for bucketName modified.
* @see ParallelDownloadConfig#getBucketName()
*/
@BetaApi
public Builder setBucketName(String bucketName) {
this.bucketName = bucketName;
return this;
Expand All @@ -192,7 +181,6 @@ public Builder setBucketName(String bucketName) {
* @return the builder instance with the value for OptionsPerRequest modified.
* @see ParallelDownloadConfig#getOptionsPerRequest()
*/
@BetaApi
public Builder setOptionsPerRequest(List<BlobSourceOption> optionsPerRequest) {
this.optionsPerRequest = ImmutableList.copyOf(optionsPerRequest);
return this;
Expand All @@ -203,7 +191,6 @@ public Builder setOptionsPerRequest(List<BlobSourceOption> optionsPerRequest) {
*
* @return {@link ParallelDownloadConfig}
*/
@BetaApi
public ParallelDownloadConfig build() {
checkNotNull(bucketName);
checkNotNull(stripPrefix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.api.core.BetaApi;
import com.google.cloud.storage.Storage.BlobWriteOption;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
Expand All @@ -31,7 +30,6 @@
*
* @see Builder
*/
@BetaApi
public final class ParallelUploadConfig {

private final boolean skipIfExists;
Expand All @@ -57,7 +55,6 @@ private ParallelUploadConfig(
*
* @see Builder#setSkipIfExists(boolean)
*/
@BetaApi
public boolean isSkipIfExists() {
return skipIfExists;
}
Expand All @@ -67,7 +64,6 @@ public boolean isSkipIfExists() {
*
* @see Builder#setPrefix(String)
*/
@BetaApi
public @NonNull String getPrefix() {
return prefix;
}
Expand All @@ -77,7 +73,6 @@ public boolean isSkipIfExists() {
*
* @see Builder#setBucketName(String)
*/
@BetaApi
public @NonNull String getBucketName() {
return bucketName;
}
Expand All @@ -87,7 +82,6 @@ public boolean isSkipIfExists() {
*
* @see Builder#setWriteOptsPerRequest(List)
*/
@BetaApi
public @NonNull List<BlobWriteOption> getWriteOptsPerRequest() {
return writeOptsPerRequest;
}
Expand Down Expand Up @@ -122,7 +116,6 @@ public String toString() {
.toString();
}

@BetaApi
public static Builder newBuilder() {
return new Builder();
}
Expand All @@ -141,7 +134,6 @@ private static List<BlobWriteOption> applySkipIfExists(
*
* @see ParallelUploadConfig
*/
@BetaApi
public static final class Builder {

private boolean skipIfExists;
Expand All @@ -162,7 +154,6 @@ private Builder() {
* @return the builder instance with the value for skipIfExists modified.
* @see ParallelUploadConfig#isSkipIfExists()
*/
@BetaApi
public Builder setSkipIfExists(boolean skipIfExists) {
this.skipIfExists = skipIfExists;
return this;
Expand All @@ -174,7 +165,6 @@ public Builder setSkipIfExists(boolean skipIfExists) {
* @return the builder instance with the value for prefix modified.
* @see ParallelUploadConfig#getPrefix()
*/
@BetaApi
public Builder setPrefix(@NonNull String prefix) {
this.prefix = prefix;
return this;
Expand All @@ -186,7 +176,6 @@ public Builder setPrefix(@NonNull String prefix) {
* @return the builder instance with the value for bucketName modified.
* @see ParallelUploadConfig#getBucketName()
*/
@BetaApi
public Builder setBucketName(@NonNull String bucketName) {
this.bucketName = bucketName;
return this;
Expand All @@ -199,7 +188,6 @@ public Builder setBucketName(@NonNull String bucketName) {
* @return the builder instance with the value for WriteOptsPerRequest modified.
* @see ParallelUploadConfig#getWriteOptsPerRequest()
*/
@BetaApi
public Builder setWriteOptsPerRequest(@NonNull List<BlobWriteOption> writeOptsPerRequest) {
this.writeOptsPerRequest = writeOptsPerRequest;
return this;
Expand All @@ -210,7 +198,6 @@ public Builder setWriteOptsPerRequest(@NonNull List<BlobWriteOption> writeOptsPe
*
* @return {@link ParallelUploadConfig}
*/
@BetaApi
public ParallelUploadConfig build() {
checkNotNull(prefix);
checkNotNull(bucketName);
Expand Down