Skip to content

Commit 1fcc8cf

Browse files
committed
[FLINK-39960][docs] Align indentation in JDBC datastream code examples
1 parent 38bf20f commit 1fcc8cf

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

  • docs
    • content.zh/docs/connectors/datastream
    • content/docs/connectors/datastream

docs/content.zh/docs/connectors/datastream/jdbc.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public class JdbcSourceExample {
208208
new Book(
209209
resultSet.getLong("id"),
210210
resultSet.getString("title")))
211-
.build();
211+
.build();
212212
env.fromSource(jdbcSource, WatermarkStrategy.noWatermarks(), "TestSource")
213213
.addSink(new DiscardingSink());
214214
env.execute();
@@ -276,8 +276,8 @@ The SQL DML statements are executed in batches, which can optionally be configur
276276
JdbcExecutionOptions.builder()
277277
.withBatchIntervalMs(200) // optional: default = 0, meaning no time-based execution is done
278278
.withBatchSize(1000) // optional: default = 5000 values
279-
.withMaxRetries(5) // optional: default = 3
280-
.build();
279+
.withMaxRetries(5) // optional: default = 3
280+
.build();
281281
```
282282
{{< /tab >}}
283283
{{< tab "Python" >}}
@@ -408,7 +408,8 @@ For example:
408408
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
409409
env
410410
.fromElements(...)
411-
.addSink(JdbcSink.exactlyOnceSink(
411+
.addSink(
412+
JdbcSink.exactlyOnceSink(
412413
"insert into books (id, title, author, price, qty) values (?,?,?,?,?)",
413414
(ps, t) -> {
414415
ps.setInt(1, t.id);
@@ -423,11 +424,11 @@ env
423424
JdbcExactlyOnceOptions.defaults(),
424425
() -> {
425426
// create a driver-specific XA DataSource
426-
// The following example is for derby
427+
// The following example is for derby
427428
EmbeddedXADataSource ds = new EmbeddedXADataSource();
428429
ds.setDatabaseName("my_db");
429430
return ds;
430-
});
431+
}));
431432
env.execute();
432433
```
433434
{{< /tab >}}
@@ -445,8 +446,8 @@ In such cases, please use the following API to construct `JdbcExactlyOnceOptions
445446
{{< tab "Java" >}}
446447
```java
447448
JdbcExactlyOnceOptions.builder()
448-
.withTransactionPerConnection(true)
449-
.build();
449+
.withTransactionPerConnection(true)
450+
.build();
450451
```
451452
{{< /tab >}}
452453
{{< tab "Python" >}}

docs/content/docs/connectors/datastream/jdbc.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public class JdbcSourceExample {
208208
new Book(
209209
resultSet.getLong("id"),
210210
resultSet.getString("title")))
211-
.build();
211+
.build();
212212
env.fromSource(jdbcSource, WatermarkStrategy.noWatermarks(), "TestSource")
213213
.addSink(new DiscardingSink());
214214
env.execute();
@@ -276,8 +276,8 @@ The SQL DML statements are executed in batches, which can optionally be configur
276276
JdbcExecutionOptions.builder()
277277
.withBatchIntervalMs(200) // optional: default = 0, meaning no time-based execution is done
278278
.withBatchSize(1000) // optional: default = 5000 values
279-
.withMaxRetries(5) // optional: default = 3
280-
.build();
279+
.withMaxRetries(5) // optional: default = 3
280+
.build();
281281
```
282282
{{< /tab >}}
283283
{{< tab "Python" >}}
@@ -423,7 +423,7 @@ env
423423
JdbcExactlyOnceOptions.defaults(),
424424
() -> {
425425
// create a driver-specific XA DataSource
426-
// The following example is for derby
426+
// The following example is for derby
427427
EmbeddedXADataSource ds = new EmbeddedXADataSource();
428428
ds.setDatabaseName("my_db");
429429
return ds;
@@ -445,8 +445,8 @@ In such cases, please use the following API to construct `JdbcExactlyOnceOptions
445445
{{< tab "Java" >}}
446446
```java
447447
JdbcExactlyOnceOptions.builder()
448-
.withTransactionPerConnection(true)
449-
.build();
448+
.withTransactionPerConnection(true)
449+
.build();
450450
```
451451
{{< /tab >}}
452452
{{< tab "Python" >}}

0 commit comments

Comments
 (0)