Skip to content

Commit ceb94a1

Browse files
committed
add javadocs to SpannerConfig
1 parent 361e6da commit ceb94a1

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner

sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerConfig.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,82 +148,107 @@ abstract Builder setExecuteStreamingSqlRetrySettings(
148148
public abstract SpannerConfig build();
149149
}
150150

151+
/** Specifies the Cloud Spanner project ID */
151152
public SpannerConfig withProjectId(ValueProvider<String> projectId) {
152153
return toBuilder().setProjectId(projectId).build();
153154
}
154155

156+
/** Specifies the Cloud Spanner project ID */
155157
public SpannerConfig withProjectId(String projectId) {
156158
return withProjectId(ValueProvider.StaticValueProvider.of(projectId));
157159
}
158160

161+
/** Specifies the Cloud Spanner instance ID */
159162
public SpannerConfig withInstanceId(ValueProvider<String> instanceId) {
160163
return toBuilder().setInstanceId(instanceId).build();
161164
}
162165

166+
/** Specifies the Cloud Spanner instance ID */
163167
public SpannerConfig withInstanceId(String instanceId) {
164168
return withInstanceId(ValueProvider.StaticValueProvider.of(instanceId));
165169
}
166170

171+
/** Specifies the Cloud Spanner database ID */
167172
public SpannerConfig withDatabaseId(ValueProvider<String> databaseId) {
168173
return toBuilder().setDatabaseId(databaseId).build();
169174
}
170175

176+
/** Specifies the Cloud Spanner database ID */
171177
public SpannerConfig withDatabaseId(String databaseId) {
172178
return withDatabaseId(ValueProvider.StaticValueProvider.of(databaseId));
173179
}
174180

181+
/** Specifies the Cloud Spanner host */
175182
public SpannerConfig withHost(ValueProvider<String> host) {
176183
return toBuilder().setHost(host).build();
177184
}
178185

186+
/** Specifies the Cloud Spanner host, when an emulator is used */
179187
public SpannerConfig withEmulatorHost(ValueProvider<String> emulatorHost) {
180188
return toBuilder().setEmulatorHost(emulatorHost).build();
181189
}
182190

191+
/**
192+
* Specifies whether a local channel provider should be used. This should be set to True when an
193+
* emulator is used.
194+
*/
183195
public SpannerConfig withIsLocalChannelProvider(ValueProvider<Boolean> isLocalChannelProvider) {
184196
return toBuilder().setIsLocalChannelProvider(isLocalChannelProvider).build();
185197
}
186198

199+
/** Specifies the commit deadline. This is overridden if the CommitRetrySettings is specified. */
187200
public SpannerConfig withCommitDeadline(Duration commitDeadline) {
188201
return withCommitDeadline(ValueProvider.StaticValueProvider.of(commitDeadline));
189202
}
190203

204+
/** Specifies the commit deadline. This is overridden if the CommitRetrySettings is specified. */
191205
public SpannerConfig withCommitDeadline(ValueProvider<Duration> commitDeadline) {
192206
return toBuilder().setCommitDeadline(commitDeadline).build();
193207
}
194208

209+
/** Specifies the maximum cumulative backoff. */
195210
public SpannerConfig withMaxCumulativeBackoff(Duration maxCumulativeBackoff) {
196211
return withMaxCumulativeBackoff(ValueProvider.StaticValueProvider.of(maxCumulativeBackoff));
197212
}
198213

214+
/** Specifies the maximum cumulative backoff. */
199215
public SpannerConfig withMaxCumulativeBackoff(ValueProvider<Duration> maxCumulativeBackoff) {
200216
return toBuilder().setMaxCumulativeBackoff(maxCumulativeBackoff).build();
201217
}
202218

219+
/**
220+
* Specifies the ExecuteStreamingSql retry settings. If not set, the default timeout is set to 2
221+
* hours.
222+
*/
203223
public SpannerConfig withExecuteStreamingSqlRetrySettings(
204224
RetrySettings executeStreamingSqlRetrySettings) {
205225
return toBuilder()
206226
.setExecuteStreamingSqlRetrySettings(executeStreamingSqlRetrySettings)
207227
.build();
208228
}
209229

230+
/** Specifies the commit retry settings. Setting this overrides the commit deadline. */
210231
public SpannerConfig withCommitRetrySettings(RetrySettings commitRetrySettings) {
211232
return toBuilder().setCommitRetrySettings(commitRetrySettings).build();
212233
}
213234

235+
/** Specifies the errors that will be retried by the client library for all operations. */
214236
public SpannerConfig withRetryableCodes(ImmutableSet<Code> retryableCodes) {
215237
return toBuilder().setRetryableCodes(retryableCodes).build();
216238
}
217239

240+
/** Specifies the service factory to create instance of Spanner. */
218241
@VisibleForTesting
219242
SpannerConfig withServiceFactory(ServiceFactory<Spanner, SpannerOptions> serviceFactory) {
220243
return toBuilder().setServiceFactory(serviceFactory).build();
221244
}
222245

246+
/** Specifies the RPC priority. */
223247
public SpannerConfig withRpcPriority(RpcPriority rpcPriority) {
224248
return withRpcPriority(ValueProvider.StaticValueProvider.of(rpcPriority));
225249
}
226250

251+
/** Specifies the RPC priority. */
227252
public SpannerConfig withRpcPriority(ValueProvider<RpcPriority> rpcPriority) {
228253
return toBuilder().setRpcPriority(rpcPriority).build();
229254
}

0 commit comments

Comments
 (0)