Skip to content

Commit 1f26a28

Browse files
authored
fix: fix ExportJob timeout options (#4537)
* fix: fix ExportJob timeout options * fix
1 parent 9de2b9c commit 1f26a28

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

bigtable-dataflow-parent/bigtable-beam-import/src/main/java/com/google/cloud/bigtable/beam/TemplateUtils.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,14 @@ public static CloudBigtableScanConfiguration buildExportConfig(ExportOptions opt
9797
options.getBigtableMaxVersions(),
9898
options.getBigtableFilter()));
9999
if (options.getBigtableReadRpcTimeoutMs() != null) {
100-
ValueProvider.NestedValueProvider.of(
101-
options.getBigtableReadRpcTimeoutMs(),
102-
(Integer timeout) -> {
103-
if (timeout != null) {
104-
configBuilder.withConfiguration(
105-
BigtableOptionsFactory.BIGTABLE_READ_RPC_TIMEOUT_MS_KEY, String.valueOf(timeout));
106-
}
107-
return null;
108-
});
100+
configBuilder.withConfiguration(
101+
BigtableOptionsFactory.BIGTABLE_READ_RPC_TIMEOUT_MS_KEY,
102+
options.getBigtableReadRpcTimeoutMs());
109103
}
110104
if (options.getBigtableReadRpcAttemptTimeoutMs() != null) {
111-
ValueProvider.NestedValueProvider.of(
112-
options.getBigtableReadRpcAttemptTimeoutMs(),
113-
(Integer timeout) -> {
114-
if (timeout != null) {
115-
configBuilder.withConfiguration(
116-
BigtableOptionsFactory.BIGTABLE_READ_RPC_ATTEMPT_TIMEOUT_MS_KEY,
117-
String.valueOf(timeout));
118-
}
119-
return null;
120-
});
105+
configBuilder.withConfiguration(
106+
BigtableOptionsFactory.BIGTABLE_READ_RPC_ATTEMPT_TIMEOUT_MS_KEY,
107+
options.getBigtableReadRpcAttemptTimeoutMs());
121108
}
122109
return configBuilder.build();
123110
}

bigtable-dataflow-parent/bigtable-beam-import/src/main/java/com/google/cloud/bigtable/beam/sequencefiles/ExportJob.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,16 @@ public interface ExportOptions extends GcpOptions, GcsOptions {
181181
void setRetryIdleTimeout(boolean retryIdleTimeout);
182182

183183
@Description("Read RPC timeout in milliseconds.")
184-
ValueProvider<Integer> getBigtableReadRpcTimeoutMs();
184+
ValueProvider<String> getBigtableReadRpcTimeoutMs();
185185

186186
@SuppressWarnings("unused")
187-
void setBigtableReadRpcTimeoutMs(ValueProvider<Integer> readRpcTimeoutMs);
187+
void setBigtableReadRpcTimeoutMs(ValueProvider<String> readRpcTimeoutMs);
188188

189189
@Description("Read RPC attempt timeout in milliseconds.")
190-
ValueProvider<Integer> getBigtableReadRpcAttemptTimeoutMs();
190+
ValueProvider<String> getBigtableReadRpcAttemptTimeoutMs();
191191

192192
@SuppressWarnings("unused")
193-
void setBigtableReadRpcAttemptTimeoutMs(ValueProvider<Integer> readRpcAttemptTimeoutMs);
193+
void setBigtableReadRpcAttemptTimeoutMs(ValueProvider<String> readRpcAttemptTimeoutMs);
194194
}
195195

196196
public static void main(String[] args) {

0 commit comments

Comments
 (0)