Skip to content

Commit 245dec7

Browse files
committed
chore: remove obsolete internal hasher option
All appendable uploads will crc32c checksum their segments always.
1 parent 72f9901 commit 245dec7

File tree

1 file changed

+4
-48
lines changed

1 file changed

+4
-48
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/BlobAppendableUploadConfig.java

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.google.api.core.ApiFuture;
2323
import com.google.api.core.ApiFutures;
2424
import com.google.api.core.BetaApi;
25-
import com.google.api.core.InternalApi;
2625
import com.google.api.core.SettableApiFuture;
2726
import com.google.cloud.storage.BidiUploadState.AppendableUploadState;
2827
import com.google.cloud.storage.BidiUploadState.TakeoverAppendableUploadState;
@@ -53,18 +52,13 @@ public final class BlobAppendableUploadConfig {
5352

5453
private static final BlobAppendableUploadConfig INSTANCE =
5554
new BlobAppendableUploadConfig(
56-
FlushPolicy.minFlushSize(_256KiB),
57-
Hasher.enabled(),
58-
CloseAction.CLOSE_WITHOUT_FINALIZING);
55+
FlushPolicy.minFlushSize(_256KiB), CloseAction.CLOSE_WITHOUT_FINALIZING);
5956

6057
private final FlushPolicy flushPolicy;
61-
private final Hasher hasher;
6258
private final CloseAction closeAction;
6359

64-
private BlobAppendableUploadConfig(
65-
FlushPolicy flushPolicy, Hasher hasher, CloseAction closeAction) {
60+
private BlobAppendableUploadConfig(FlushPolicy flushPolicy, CloseAction closeAction) {
6661
this.flushPolicy = flushPolicy;
67-
this.hasher = hasher;
6862
this.closeAction = closeAction;
6963
}
7064

@@ -96,7 +90,7 @@ public BlobAppendableUploadConfig withFlushPolicy(FlushPolicy flushPolicy) {
9690
if (this.flushPolicy.equals(flushPolicy)) {
9791
return this;
9892
}
99-
return new BlobAppendableUploadConfig(flushPolicy, hasher, closeAction);
93+
return new BlobAppendableUploadConfig(flushPolicy, closeAction);
10094
}
10195

10296
/**
@@ -126,45 +120,7 @@ public BlobAppendableUploadConfig withCloseAction(CloseAction closeAction) {
126120
if (this.closeAction == closeAction) {
127121
return this;
128122
}
129-
return new BlobAppendableUploadConfig(flushPolicy, hasher, closeAction);
130-
}
131-
132-
/**
133-
* Whether crc32c validation will be performed for bytes returned by Google Cloud Storage
134-
*
135-
* <p><i>Default:</i> {@code true}
136-
*
137-
* @since 2.51.0 This new api is in preview and is subject to breaking changes.
138-
*/
139-
@BetaApi
140-
boolean getCrc32cValidationEnabled() {
141-
return Hasher.enabled().equals(hasher);
142-
}
143-
144-
/**
145-
* Return an instance with crc32c validation enabled based on {@code enabled}.
146-
*
147-
* <p><i>Default:</i> {@code true}
148-
*
149-
* @param enabled Whether crc32c validation will be performed for bytes returned by Google Cloud
150-
* Storage
151-
* @since 2.51.0 This new api is in preview and is subject to breaking changes.
152-
*/
153-
@BetaApi
154-
BlobAppendableUploadConfig withCrc32cValidationEnabled(boolean enabled) {
155-
if (enabled && Hasher.enabled().equals(hasher)) {
156-
return this;
157-
} else if (!enabled && Hasher.noop().equals(hasher)) {
158-
return this;
159-
}
160-
return new BlobAppendableUploadConfig(
161-
flushPolicy, enabled ? Hasher.enabled() : Hasher.noop(), closeAction);
162-
}
163-
164-
/** Never to be made public until {@link Hasher} is public */
165-
@InternalApi
166-
Hasher getHasher() {
167-
return hasher;
123+
return new BlobAppendableUploadConfig(flushPolicy, closeAction);
168124
}
169125

170126
@Override

0 commit comments

Comments
 (0)