|
22 | 22 | import com.google.api.core.ApiFuture; |
23 | 23 | import com.google.api.core.ApiFutures; |
24 | 24 | import com.google.api.core.BetaApi; |
25 | | -import com.google.api.core.InternalApi; |
26 | 25 | import com.google.api.core.SettableApiFuture; |
27 | 26 | import com.google.cloud.storage.BidiUploadState.AppendableUploadState; |
28 | 27 | import com.google.cloud.storage.BidiUploadState.TakeoverAppendableUploadState; |
@@ -53,18 +52,13 @@ public final class BlobAppendableUploadConfig { |
53 | 52 |
|
54 | 53 | private static final BlobAppendableUploadConfig INSTANCE = |
55 | 54 | new BlobAppendableUploadConfig( |
56 | | - FlushPolicy.minFlushSize(_256KiB), |
57 | | - Hasher.enabled(), |
58 | | - CloseAction.CLOSE_WITHOUT_FINALIZING); |
| 55 | + FlushPolicy.minFlushSize(_256KiB), CloseAction.CLOSE_WITHOUT_FINALIZING); |
59 | 56 |
|
60 | 57 | private final FlushPolicy flushPolicy; |
61 | | - private final Hasher hasher; |
62 | 58 | private final CloseAction closeAction; |
63 | 59 |
|
64 | | - private BlobAppendableUploadConfig( |
65 | | - FlushPolicy flushPolicy, Hasher hasher, CloseAction closeAction) { |
| 60 | + private BlobAppendableUploadConfig(FlushPolicy flushPolicy, CloseAction closeAction) { |
66 | 61 | this.flushPolicy = flushPolicy; |
67 | | - this.hasher = hasher; |
68 | 62 | this.closeAction = closeAction; |
69 | 63 | } |
70 | 64 |
|
@@ -96,7 +90,7 @@ public BlobAppendableUploadConfig withFlushPolicy(FlushPolicy flushPolicy) { |
96 | 90 | if (this.flushPolicy.equals(flushPolicy)) { |
97 | 91 | return this; |
98 | 92 | } |
99 | | - return new BlobAppendableUploadConfig(flushPolicy, hasher, closeAction); |
| 93 | + return new BlobAppendableUploadConfig(flushPolicy, closeAction); |
100 | 94 | } |
101 | 95 |
|
102 | 96 | /** |
@@ -126,45 +120,7 @@ public BlobAppendableUploadConfig withCloseAction(CloseAction closeAction) { |
126 | 120 | if (this.closeAction == closeAction) { |
127 | 121 | return this; |
128 | 122 | } |
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); |
168 | 124 | } |
169 | 125 |
|
170 | 126 | @Override |
|
0 commit comments