From 746c8b6d0c0720d69f63703f362c6f14aca03fa7 Mon Sep 17 00:00:00 2001 From: Igor Dvorzhak Date: Fri, 13 Mar 2020 14:33:22 -0700 Subject: [PATCH] Remove deprecated methods (#327) --- bigquery/CHANGES.md | 2 +- bigquery/pom.xml | 4 +- coverage/pom.xml | 4 +- gcs/CHANGES.md | 4 +- gcs/pom.xml | 4 +- ...ogleHadoopOutputStreamIntegrationTest.java | 2 +- .../GoogleHadoopSyncableOutputStreamTest.java | 2 +- gcsio/pom.xml | 4 +- .../cloud/hadoop/gcsio/CreateFileOptions.java | 3 - .../gcsio/GoogleCloudStorageFileSystem.java | 2 +- .../GoogleCloudStorageFileSystemOptions.java | 10 +- .../gcsio/GoogleCloudStorageOptions.java | 10 +- .../gcsio/GoogleCloudStorageReadOptions.java | 4 +- .../gcsio/GoogleCloudStorageWriteChannel.java | 108 ------------------ ...manceCachingGoogleCloudStorageOptions.java | 4 +- .../cooplock/CooperativeLockingOptions.java | 4 +- .../GoogleCloudStorageIntegrationHelper.java | 2 +- .../GoogleCloudStorageWriteChannelTest.java | 1 + pom.xml | 6 +- util-hadoop/pom.xml | 4 +- util/pom.xml | 4 +- .../util/AbstractGoogleAsyncWriteChannel.java | 25 +--- .../cloud/hadoop/util/ApiErrorExtractor.java | 19 --- .../hadoop/util/AsyncWriteChannelOptions.java | 10 +- .../cloud/hadoop/util/CredentialOptions.java | 4 +- .../hadoop/util/RequesterPaysOptions.java | 4 +- 26 files changed, 45 insertions(+), 205 deletions(-) diff --git a/bigquery/CHANGES.md b/bigquery/CHANGES.md index e7f47afc30..a5873c4ce8 100644 --- a/bigquery/CHANGES.md +++ b/bigquery/CHANGES.md @@ -1,4 +1,4 @@ -### 1.1.2 - 2020-XX-XX +### 1.2.0 - 2020-XX-XX ### 1.1.1 - 2020-03-11 diff --git a/bigquery/pom.xml b/bigquery/pom.xml index dd42852a10..432e6c513b 100644 --- a/bigquery/pom.xml +++ b/bigquery/pom.xml @@ -22,7 +22,7 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml @@ -32,7 +32,7 @@ bigquery-connector - ${hadoop.identifier}-1.1.2-SNAPSHOT + ${hadoop.identifier}-1.2.0-SNAPSHOT diff --git a/coverage/pom.xml b/coverage/pom.xml index 5e76318f0e..f1f7994518 100644 --- a/coverage/pom.xml +++ b/coverage/pom.xml @@ -7,11 +7,11 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT coverage - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT pom diff --git a/gcs/CHANGES.md b/gcs/CHANGES.md index 6b1a37fcc4..7f2d39f966 100644 --- a/gcs/CHANGES.md +++ b/gcs/CHANGES.md @@ -1,4 +1,6 @@ -### 2.1.2 - 2020-XX-XX +### 2.2.0 - 2020-XX-XX + +1. Delete deprecated methods. ### 2.1.1 - 2020-03-11 diff --git a/gcs/pom.xml b/gcs/pom.xml index ad39690547..01842558f2 100644 --- a/gcs/pom.xml +++ b/gcs/pom.xml @@ -22,7 +22,7 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml @@ -32,7 +32,7 @@ gcs-connector - ${hadoop.identifier}-2.1.2-SNAPSHOT + ${hadoop.identifier}-2.2.0-SNAPSHOT diff --git a/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopOutputStreamIntegrationTest.java b/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopOutputStreamIntegrationTest.java index 1ebee662fb..3749eaa912 100644 --- a/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopOutputStreamIntegrationTest.java +++ b/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopOutputStreamIntegrationTest.java @@ -70,7 +70,7 @@ public void write_withZeroBufferSize() throws Exception { ghfs, new URI(testFile.toString()), new FileSystem.Statistics(ghfs.getScheme()), - CreateFileOptions.DEFAULT)) { + CreateFileOptions.DEFAULT_OVERWRITE)) { out.write(1); } diff --git a/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopSyncableOutputStreamTest.java b/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopSyncableOutputStreamTest.java index 5bec2cbbbb..a0c78dfc97 100644 --- a/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopSyncableOutputStreamTest.java +++ b/gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopSyncableOutputStreamTest.java @@ -124,7 +124,7 @@ public void testExceptionOnDelete() throws IOException { ghfs, ghfs.getGcsPath(objectPath), new FileSystem.Statistics(ghfs.getScheme()), - CreateFileOptions.DEFAULT, + CreateFileOptions.DEFAULT_OVERWRITE, mockExecutorService, /* appendMode= */ false); diff --git a/gcsio/pom.xml b/gcsio/pom.xml index b79207a3aa..f8d9766ab4 100644 --- a/gcsio/pom.xml +++ b/gcsio/pom.xml @@ -22,7 +22,7 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml @@ -32,7 +32,7 @@ gcsio - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/CreateFileOptions.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/CreateFileOptions.java index dd0c506aae..7e80a5b35c 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/CreateFileOptions.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/CreateFileOptions.java @@ -34,9 +34,6 @@ public class CreateFileOptions { public static final CreateFileOptions DEFAULT_NO_OVERWRITE = new CreateFileOptions(/* overwriteExisting= */ true, DEFAULT_CONTENT_TYPE, EMPTY_ATTRIBUTES); - /** @deprecated use {@link #DEFAULT_NO_OVERWRITE} instead */ - @Deprecated public static final CreateFileOptions DEFAULT = DEFAULT_OVERWRITE; - private final boolean overwriteExisting; private final String contentType; private final Map attributes; diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java index 381e5045dd..d890ee3c2b 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java @@ -193,7 +193,7 @@ public static CreateObjectOptions objectOptionsFromFileOptions(CreateFileOptions */ public WritableByteChannel create(URI path) throws IOException { logger.atFine().log("create(path: %s)", path); - return create(path, CreateFileOptions.DEFAULT); + return create(path, CreateFileOptions.DEFAULT_OVERWRITE); } /** diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemOptions.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemOptions.java index 5d755447a4..7f9a0e1aa0 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemOptions.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemOptions.java @@ -22,12 +22,6 @@ @AutoValue public abstract class GoogleCloudStorageFileSystemOptions { - /** @deprecated use {@link #builder()} instead */ - @Deprecated - public static Builder newBuilder() { - return builder(); - } - public static Builder builder() { return new AutoValue_GoogleCloudStorageFileSystemOptions.Builder() .setPerformanceCacheEnabled(false) @@ -39,6 +33,8 @@ public static Builder builder() { .setCooperativeLockingEnabled(false); } + public abstract Builder toBuilder(); + public abstract boolean isPerformanceCacheEnabled(); public abstract PerformanceCachingGoogleCloudStorageOptions getPerformanceCacheOptions(); @@ -58,8 +54,6 @@ public void throwIfNotValid() { getCloudStorageOptions().throwIfNotValid(); } - public abstract Builder toBuilder(); - /** Mutable builder for {@link GoogleCloudStorageFileSystemOptions}. */ @AutoValue.Builder public abstract static class Builder { diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageOptions.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageOptions.java index 0c6aee219d..bc40c26c15 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageOptions.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageOptions.java @@ -81,12 +81,6 @@ public abstract class GoogleCloudStorageOptions { public static final GoogleCloudStorageOptions DEFAULT = builder().build(); - /** @deprecated use {@link #builder()} instead */ - @Deprecated - public static Builder newBuilder() { - return builder(); - } - public static Builder builder() { return new AutoValue_GoogleCloudStorageOptions.Builder() .setStorageRootUrl(STORAGE_ROOT_URL_DEFAULT) @@ -111,6 +105,8 @@ public static Builder builder() { .setHttpRequestHeaders(HTTP_REQUEST_HEADERS_DEFAULT); } + public abstract Builder toBuilder(); + public abstract String getStorageRootUrl(); @Nullable @@ -166,8 +162,6 @@ public static Builder builder() { public abstract ImmutableMap getHttpRequestHeaders(); - public abstract Builder toBuilder(); - public void throwIfNotValid() { checkArgument(!isNullOrEmpty(getAppName()), "appName must not be null or empty"); } diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadOptions.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadOptions.java index 3526e49447..8df4c3b88d 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadOptions.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadOptions.java @@ -65,6 +65,8 @@ public static Builder builder() { .setMinRangeRequestSize(DEFAULT_MIN_RANGE_REQUEST_SIZE); } + public abstract Builder toBuilder(); + /** See {@link Builder#setBackoffInitialIntervalMillis}. */ public abstract int getBackoffInitialIntervalMillis(); @@ -98,8 +100,6 @@ public static Builder builder() { /** See {@link Builder#setMinRangeRequestSize}. */ public abstract int getMinRangeRequestSize(); - public abstract Builder toBuilder(); - /** Mutable builder for GoogleCloudStorageReadOptions. */ @AutoValue.Builder public abstract static class Builder { diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannel.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannel.java index a93aed48a8..fc5f2ba0b0 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannel.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannel.java @@ -45,114 +45,6 @@ public class GoogleCloudStorageWriteChannel private GoogleCloudStorageItemInfo completedItemInfo = null; - /** - * Constructs an instance of GoogleCloudStorageWriteChannel. - * - * @param uploadThreadPool thread pool to use for running the upload operation - * @param gcs storage object instance - * @param requestHelper a ClientRequestHelper to set extra headers - * @param bucketName name of the bucket to create object in - * @param objectName name of the object to create - * @param writeConditions conditions on which write should be allowed to continue - * @param objectMetadata metadata to apply to the newly created object - */ - @Deprecated - public GoogleCloudStorageWriteChannel( - ExecutorService uploadThreadPool, - Storage gcs, - ClientRequestHelper requestHelper, - String bucketName, - String objectName, - AsyncWriteChannelOptions options, - ObjectWriteConditions writeConditions, - Map objectMetadata) { - this( - uploadThreadPool, - gcs, - requestHelper, - bucketName, - objectName, - /* contentType= */ null, - /* kmsKeyName= */ null, - options, - writeConditions, - objectMetadata); - } - - /** - * Constructs an instance of GoogleCloudStorageWriteChannel. - * - * @param uploadThreadPool thread pool to use for running the upload operation - * @param gcs storage object instance - * @param requestHelper a ClientRequestHelper to set extra headers - * @param bucketName name of the bucket to create object in - * @param objectName name of the object to create - * @param writeConditions conditions on which write should be allowed to continue - * @param objectMetadata metadata to apply to the newly created object - * @param contentType content type - */ - @Deprecated - public GoogleCloudStorageWriteChannel( - ExecutorService uploadThreadPool, - Storage gcs, - ClientRequestHelper requestHelper, - String bucketName, - String objectName, - AsyncWriteChannelOptions options, - ObjectWriteConditions writeConditions, - Map objectMetadata, - String contentType) { - this( - uploadThreadPool, - gcs, - requestHelper, - bucketName, - objectName, - contentType, - /* kmsKeyName= */ null, - options, - writeConditions, - objectMetadata); - } - - /** - * Constructs an instance of GoogleCloudStorageWriteChannel. - * - * @param uploadThreadPool thread pool to use for running the upload operation - * @param gcs storage object instance - * @param requestHelper a ClientRequestHelper to set extra headers - * @param bucketName name of the bucket to create object in - * @param objectName name of the object to create - * @param contentType content type - * @param kmsKeyName Name of Cloud KMS key to use to encrypt the newly created object - * @param writeConditions conditions on which write should be allowed to continue - * @param objectMetadata metadata to apply to the newly created object - */ - @Deprecated - public GoogleCloudStorageWriteChannel( - ExecutorService uploadThreadPool, - Storage gcs, - ClientRequestHelper requestHelper, - String bucketName, - String objectName, - String contentType, - String kmsKeyName, - AsyncWriteChannelOptions options, - ObjectWriteConditions writeConditions, - Map objectMetadata) { - this( - uploadThreadPool, - gcs, - requestHelper, - bucketName, - objectName, - contentType, - /* contentEncoding= */ null, - kmsKeyName, - options, - writeConditions, - objectMetadata); - } /** * Constructs an instance of GoogleCloudStorageWriteChannel. * diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorageOptions.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorageOptions.java index 04c828f4b6..30ece273a5 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorageOptions.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/PerformanceCachingGoogleCloudStorageOptions.java @@ -24,6 +24,8 @@ public abstract class PerformanceCachingGoogleCloudStorageOptions { public static final PerformanceCachingGoogleCloudStorageOptions DEFAULT = builder().build(); + public abstract Builder toBuilder(); + public static Builder builder() { return new AutoValue_PerformanceCachingGoogleCloudStorageOptions.Builder() .setMaxEntryAgeMillis(MAX_ENTRY_AGE_MILLIS_DEFAULT); @@ -32,8 +34,6 @@ public static Builder builder() { /** Gets the max age of an item in cache in milliseconds. */ public abstract long getMaxEntryAgeMillis(); - public abstract Builder toBuilder(); - /** Builder class for PerformanceCachingGoogleCloudStorageOptions. */ @AutoValue.Builder public abstract static class Builder { diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/cooplock/CooperativeLockingOptions.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/cooplock/CooperativeLockingOptions.java index 3dd6553a70..e574a8bddd 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/cooplock/CooperativeLockingOptions.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/cooplock/CooperativeLockingOptions.java @@ -38,12 +38,12 @@ public static Builder builder() { .setMaxConcurrentOperations(MAX_CONCURRENT_OPERATIONS_DEFAULT); } + public abstract Builder toBuilder(); + public abstract long getLockExpirationTimeoutMilli(); public abstract int getMaxConcurrentOperations(); - public abstract Builder toBuilder(); - /** Builder for {@link CooperativeLockingOptions} */ @AutoValue.Builder public abstract static class Builder { diff --git a/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageIntegrationHelper.java b/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageIntegrationHelper.java index b82145b852..cd7863900a 100644 --- a/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageIntegrationHelper.java +++ b/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageIntegrationHelper.java @@ -244,7 +244,7 @@ protected abstract SeekableByteChannel open( /** Opens the given object for writing. */ protected WritableByteChannel create(String bucketName, String objectName) throws IOException { - return create(bucketName, objectName, CreateFileOptions.DEFAULT); + return create(bucketName, objectName, CreateFileOptions.DEFAULT_OVERWRITE); } /** Opens the given object for writing. */ diff --git a/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannelTest.java b/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannelTest.java index 0a4aa2123a..a49c097c61 100644 --- a/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannelTest.java +++ b/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageWriteChannelTest.java @@ -47,6 +47,7 @@ public void createRequest_shouldSetKmsKeyName() throws IOException { BUCKET_NAME, OBJECT_NAME, "content-type", + /* contentEncoding= */ null, kmsKeyName, AsyncWriteChannelOptions.DEFAULT, new ObjectWriteConditions(), diff --git a/pom.xml b/pom.xml index b523a34208..9120dea1a5 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT pom https://github.com/GoogleCloudDataproc/hadoop-connectors @@ -80,8 +80,8 @@ true - 2.1.2-SNAPSHOT - 1.1.2-SNAPSHOT + 2.2.0-SNAPSHOT + 1.2.0-SNAPSHOT 1.7.7 diff --git a/util-hadoop/pom.xml b/util-hadoop/pom.xml index 06e0b6b24a..cb90b91bc7 100644 --- a/util-hadoop/pom.xml +++ b/util-hadoop/pom.xml @@ -22,14 +22,14 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml util-hadoop-${hadoop.identifier} util-hadoop - ${hadoop.identifier}-2.1.2-SNAPSHOT + ${hadoop.identifier}-2.2.0-SNAPSHOT diff --git a/util/pom.xml b/util/pom.xml index 68eceb2a70..2853cc5d3c 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -22,12 +22,12 @@ com.google.cloud.bigdataoss bigdataoss-parent - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml util - 2.1.2-SNAPSHOT + 2.2.0-SNAPSHOT diff --git a/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java b/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java index bcc5ab1f84..d7b239fb1e 100644 --- a/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java +++ b/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java @@ -88,8 +88,8 @@ public AbstractGoogleAsyncWriteChannel( if (options.getUploadCacheSize() > 0) { this.uploadCache = ByteBuffer.allocate(options.getUploadCacheSize()); } - setUploadChunkSize(options.getUploadChunkSize()); - setDirectUploadEnabled(options.isDirectUploadEnabled()); + this.uploadChunkSize = validateUploadChunkSize(options.getUploadChunkSize()); + this.directUploadEnabled = options.isDirectUploadEnabled(); setContentType("application/octet-stream"); } @@ -128,17 +128,11 @@ public void handleResponse(S response) throws IOException {} * may override this method to return the expected "identifier" response. Return null to let the * exception propagate through correctly. */ - public S createResponseFromException(IOException ioe) { + public S createResponseFromException(IOException e) { return null; } - @Deprecated - public void setUploadBufferSize(int bufferSize) { - setUploadChunkSize(bufferSize); - } - - /** Sets size of upload buffer used. */ - public void setUploadChunkSize(int chunkSize) { + private static int validateUploadChunkSize(int chunkSize) { Preconditions.checkArgument(chunkSize > 0, "Upload chunk size must be great than 0."); Preconditions.checkArgument( chunkSize % MediaHttpUploader.MINIMUM_CHUNK_SIZE == 0, @@ -148,16 +142,7 @@ public void setUploadChunkSize(int chunkSize) { "Upload chunk size should be a multiple of %s for best performance, got %s", GCS_UPLOAD_GRANULARITY, chunkSize); } - uploadChunkSize = chunkSize; - } - - /** - * Enables or disables direct uploads. - * - * @see MediaHttpUploader#setDirectUploadEnabled(boolean) - */ - public void setDirectUploadEnabled(boolean enableDirectUpload) { - directUploadEnabled = enableDirectUpload; + return chunkSize; } /** Returns true if direct media uploads are enabled. */ diff --git a/util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java b/util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java index e3c4e64891..5aa7abe4ce 100644 --- a/util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java +++ b/util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java @@ -72,10 +72,6 @@ public class ApiErrorExtractor { // as an unknown key. private static final String DEBUG_INFO_FIELD = "debugInfo"; - /** @deprecated use {@link #INSTANCE} instead */ - @Deprecated - public ApiErrorExtractor() {} - /** * Determines if the given exception indicates intermittent request failure or failure caused by * user error. @@ -126,12 +122,6 @@ public boolean accessDeniedNonRecoverable(IOException e) { return ACCOUNT_DISABLED_REASON.equals(reason) || ACCESS_NOT_CONFIGURED_REASON.equals(reason); } - /** @deprecated use {@link #clientError(IOException)} instead */ - @Deprecated - public boolean isClientError(IOException e) { - return clientError(e); - } - /** Determines if the exception is a client error. */ public boolean clientError(IOException e) { GoogleJsonResponseException jsonException = getJsonResponseException(e); @@ -152,15 +142,6 @@ public boolean itemAlreadyExists(IOException e) { return recursiveCheckForCode(e, HttpStatusCodes.STATUS_CODE_CONFLICT); } - /** - * @deprecated use {@link #itemNotFound(IOException)} or {@code e.getCode() == - * HttpStatusCodes.STATUS_CODE_NOT_FOUND} instead - */ - @Deprecated - public boolean itemNotFound(GoogleJsonError e) { - return e.getCode() == HttpStatusCodes.STATUS_CODE_NOT_FOUND; - } - /** * Determines if the given exception indicates 'item not found'. Recursively checks getCause() if * outer exception isn't an instance of the correct class. diff --git a/util/src/main/java/com/google/cloud/hadoop/util/AsyncWriteChannelOptions.java b/util/src/main/java/com/google/cloud/hadoop/util/AsyncWriteChannelOptions.java index f42d057213..688200d2c8 100644 --- a/util/src/main/java/com/google/cloud/hadoop/util/AsyncWriteChannelOptions.java +++ b/util/src/main/java/com/google/cloud/hadoop/util/AsyncWriteChannelOptions.java @@ -35,14 +35,6 @@ public abstract class AsyncWriteChannelOptions { /** Default of whether to use direct upload. */ public static final boolean DIRECT_UPLOAD_ENABLED_DEFAULT = false; - /** @deprecated use {@link #builder} */ - @Deprecated - public static Builder newBuilder() { - return builder(); - } - - public abstract Builder toBuilder(); - public static final AsyncWriteChannelOptions DEFAULT = builder().build(); public static Builder builder() { @@ -54,6 +46,8 @@ public static Builder builder() { .setDirectUploadEnabled(DIRECT_UPLOAD_ENABLED_DEFAULT); } + public abstract Builder toBuilder(); + public abstract int getBufferSize(); public abstract int getPipeBufferSize(); diff --git a/util/src/main/java/com/google/cloud/hadoop/util/CredentialOptions.java b/util/src/main/java/com/google/cloud/hadoop/util/CredentialOptions.java index f023e302dc..e1e13758dc 100644 --- a/util/src/main/java/com/google/cloud/hadoop/util/CredentialOptions.java +++ b/util/src/main/java/com/google/cloud/hadoop/util/CredentialOptions.java @@ -42,6 +42,8 @@ public static Builder builder() { .setTokenServerUrl(TOKEN_SERVER_URL_DEFAULT); } + public abstract Builder toBuilder(); + public abstract boolean isServiceAccountEnabled(); // The following 2 parameters are used for credentials set directly via Hadoop Configuration @@ -91,8 +93,6 @@ public static Builder builder() { @Nullable public abstract String getProxyPassword(); - public abstract Builder toBuilder(); - @Override public final String toString() { return "CredentialOptions{\n" diff --git a/util/src/main/java/com/google/cloud/hadoop/util/RequesterPaysOptions.java b/util/src/main/java/com/google/cloud/hadoop/util/RequesterPaysOptions.java index 5c0426ca2c..6dce391609 100644 --- a/util/src/main/java/com/google/cloud/hadoop/util/RequesterPaysOptions.java +++ b/util/src/main/java/com/google/cloud/hadoop/util/RequesterPaysOptions.java @@ -44,6 +44,8 @@ public static Builder builder() { .setBuckets(REQUESTER_PAYS_BUCKETS_DEFAULT); } + public abstract Builder toBuilder(); + public abstract RequesterPaysMode getMode(); @Nullable @@ -51,8 +53,6 @@ public static Builder builder() { public abstract ImmutableSet getBuckets(); - public abstract Builder toBuilder(); - /** Builder for {@link RequesterPaysOptions} */ @AutoValue.Builder public abstract static class Builder {