Skip to content

Commit

Permalink
Remove deprecated methods (GoogleCloudDataproc#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
medb authored Mar 13, 2020
1 parent 0207fe4 commit 746c8b6
Show file tree
Hide file tree
Showing 26 changed files with 45 additions and 205 deletions.
2 changes: 1 addition & 1 deletion bigquery/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.1.2 - 2020-XX-XX
### 1.2.0 - 2020-XX-XX

### 1.1.1 - 2020-03-11

Expand Down
4 changes: 2 additions & 2 deletions bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.google.cloud.bigdataoss</groupId>
<artifactId>bigdataoss-parent</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -32,7 +32,7 @@
</description>

<artifactId>bigquery-connector</artifactId>
<version>${hadoop.identifier}-1.1.2-SNAPSHOT</version>
<version>${hadoop.identifier}-1.2.0-SNAPSHOT</version>

<profiles>
<profile>
Expand Down
4 changes: 2 additions & 2 deletions coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>com.google.cloud.bigdataoss</groupId>
<artifactId>bigdataoss-parent</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<artifactId>coverage</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<packaging>pom</packaging>

<profiles>
Expand Down
4 changes: 3 additions & 1 deletion gcs/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions gcs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.google.cloud.bigdataoss</groupId>
<artifactId>bigdataoss-parent</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -32,7 +32,7 @@
</description>

<artifactId>gcs-connector</artifactId>
<version>${hadoop.identifier}-2.1.2-SNAPSHOT</version>
<version>${hadoop.identifier}-2.2.0-SNAPSHOT</version>

<profiles>
<profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions gcsio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.google.cloud.bigdataoss</groupId>
<artifactId>bigdataoss-parent</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -32,7 +32,7 @@
</description>

<artifactId>gcsio</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>

<profiles>
<profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, byte[]> attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -39,6 +33,8 @@ public static Builder builder() {
.setCooperativeLockingEnabled(false);
}

public abstract Builder toBuilder();

public abstract boolean isPerformanceCacheEnabled();

public abstract PerformanceCachingGoogleCloudStorageOptions getPerformanceCacheOptions();
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -111,6 +105,8 @@ public static Builder builder() {
.setHttpRequestHeaders(HTTP_REQUEST_HEADERS_DEFAULT);
}

public abstract Builder toBuilder();

public abstract String getStorageRootUrl();

@Nullable
Expand Down Expand Up @@ -166,8 +162,6 @@ public static Builder builder() {

public abstract ImmutableMap<String, String> getHttpRequestHeaders();

public abstract Builder toBuilder();

public void throwIfNotValid() {
checkArgument(!isNullOrEmpty(getAppName()), "appName must not be null or empty");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<StorageObject> requestHelper,
String bucketName,
String objectName,
AsyncWriteChannelOptions options,
ObjectWriteConditions writeConditions,
Map<String, String> 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<StorageObject> requestHelper,
String bucketName,
String objectName,
AsyncWriteChannelOptions options,
ObjectWriteConditions writeConditions,
Map<String, String> 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<StorageObject> requestHelper,
String bucketName,
String objectName,
String contentType,
String kmsKeyName,
AsyncWriteChannelOptions options,
ObjectWriteConditions writeConditions,
Map<String, String> objectMetadata) {
this(
uploadThreadPool,
gcs,
requestHelper,
bucketName,
objectName,
contentType,
/* contentEncoding= */ null,
kmsKeyName,
options,
writeConditions,
objectMetadata);
}
/**
* Constructs an instance of GoogleCloudStorageWriteChannel.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void createRequest_shouldSetKmsKeyName() throws IOException {
BUCKET_NAME,
OBJECT_NAME,
"content-type",
/* contentEncoding= */ null,
kmsKeyName,
AsyncWriteChannelOptions.DEFAULT,
new ObjectWriteConditions(),
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>com.google.cloud.bigdataoss</groupId>
<artifactId>bigdataoss-parent</artifactId>
<version>2.1.2-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<packaging>pom</packaging>

<url>https://github.com/GoogleCloudDataproc/hadoop-connectors</url>
Expand Down Expand Up @@ -80,8 +80,8 @@

<gpg.skip>true</gpg.skip>

<bigdataoss.version>2.1.2-SNAPSHOT</bigdataoss.version>
<bigquery-connector.version>1.1.2-SNAPSHOT</bigquery-connector.version>
<bigdataoss.version>2.2.0-SNAPSHOT</bigdataoss.version>
<bigquery-connector.version>1.2.0-SNAPSHOT</bigquery-connector.version>

<!-- Keep in sync with Hadoop dependencies -->
<apache.avro.version>1.7.7</apache.avro.version>
Expand Down
Loading

0 comments on commit 746c8b6

Please sign in to comment.