Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin-Caesar authored Feb 7, 2025
2 parents 7e350c0 + c284318 commit 49305e7
Show file tree
Hide file tree
Showing 37 changed files with 1,037 additions and 285 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
matrix:
branch:
- master
- release-3.3
- release-3.2
- release-3.1

steps:
- uses: actions/checkout@v3
Expand All @@ -69,8 +69,8 @@ jobs:
echo "flink_branch=${currentBranch}" >> ${GITHUB_ENV}
if [ "${currentBranch}" = "master" ]; then
echo "flink_alias=release-3.3" >> ${GITHUB_ENV}
elif [ "${currentBranch}" = "release-3.2" ]; then
echo "flink_alias=release-3.4" >> ${GITHUB_ENV}
elif [ "${currentBranch}" = "release-3.3" ]; then
echo "flink_alias=stable" >> ${GITHUB_ENV}
fi
Expand Down
4 changes: 2 additions & 2 deletions docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ pygmentsUseClasses = true
# where we change the version for the complete docs when forking of a release
# branch etc.
# The full version string as referenced in Maven (e.g. 1.2.1)
Version = "3.3-SNAPSHOT"
Version = "3.4-SNAPSHOT"

# For stable releases, leave the bugfix version out (e.g. 1.2). For snapshot
# release this should be the same as the regular version
VersionTitle = "3.3-SNAPSHOT"
VersionTitle = "3.4-SNAPSHOT"

# The branch for this version of Apache Flink CDC
Branch = "master"
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/db2-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,26 @@ public class Db2SourceExample {
}
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 DB2,Group 的名称会类似于 `test_database.test_schema.test_table`

The DB2 CDC incremental connector (since 3.1.0) can be used as the following shows:
```java
import org.apache.flink.api.common.eventtime.WatermarkStrategy;
Expand Down
76 changes: 76 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/mongodb-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,82 @@ public class MongoDBIncrementalSourceExample {
- 如果使用数据库正则表达式,则需要 `readAnyDatabase` 角色。
- 增量快照功能仅支持 MongoDB 4.0 之后的版本。
### 可用的指标
指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):
| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |
注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 MongoDB,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`。
### 完整的 Changelog
MongoDB 6.0 以及更高的版本支持发送变更流事件,其中包含文档的更新前和更新后的内容(或者说数据的前后镜像)。
- 前镜像是指被替换、更新或删除之前的文档。对于插入操作没有前镜像。
- 后镜像是指被替换、更新或删除之后的文档。对于删除操作没有后镜像。
MongoDB CDC 能够使用前镜像和后镜像来生成完整的变更日志流,包括插入、更新前、更新后和删除的数据行,从而避免了额外的 `ChangelogNormalize` 下游节点。
为了启用此功能,你需要满足以下条件:
- MongoDB 的版本必须为 6.0 或更高版本。
- 启用 `preAndPostImages` 功能。
```javascript
db.runCommand({
setClusterParameter: {
changeStreamOptions: {
preAndPostImages: {
expireAfterSeconds: 'off' // replace with custom image expiration time
}
}
}
})
```
- 为希望监控的 collection 启用 `changeStreamPreAndPostImages` 功能:
```javascript
db.runCommand({
collMod: "<< collection name >>",
changeStreamPreAndPostImages: {
enabled: true
}
})
```
在 DataStream 中开启 MongoDB CDC 的 `scan.full-changelog` 功能:
```java
MongoDBSource.builder()
.scanFullChangelog(true)
...
.build()
```
或者使用 Flink SQL:
```SQL
CREATE TABLE mongodb_source (...) WITH (
'connector' = 'mongodb-cdc',
'scan.full-changelog' = 'true',
...
)
```
数据类型映射
----------------
[BSON](https://docs.mongodb.com/manual/reference/bson-types/) **二进制 JSON**的缩写是一种类似 JSON 格式的二进制编码序列,用于在 MongoDB 中存储文档和进行远程过程调用。
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/mysql-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,26 @@ $ ./bin/flink run \
* 如果指定的列不存在更新操作,此时可以保证 Exactly once 语义。
* 如果指定的列存在更新操作,此时只能保证 At least once 语义。但可以结合下游,通过指定下游主键,结合幂等性操作来保证数据的正确性。

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 MySQL,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`。

数据类型映射
----------------

Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/oceanbase-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,26 @@ public class OceanBaseSourceExample {
}
```
### 可用的指标
指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):
| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |
注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 OceanBase,这里的 `namespace` 会被设置成默认值 "",也就是一个空字符串,Group 名称的格式会类似于 `test_database.test_table`
数据类型映射
----------------
Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/oracle-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,26 @@ public class OracleSourceExample {
}
```
### 可用的指标
指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):
| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |
注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 Oracle,Group 的名称会类似于 `test_database.test_schema.test_table`。
Data Type Mapping
----------------
<div class="wy-table-responsive">
Expand Down
1 change: 1 addition & 0 deletions docs/content.zh/docs/connectors/flink-sources/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following table shows the version mapping between Flink<sup>®</sup> CDC Con
| <font color="DarkCyan">3.0.*</font> | <font color="MediumVioletRed">1.14.\*</font>, <font color="MediumVioletRed">1.15.\*</font>, <font color="MediumVioletRed">1.16.\*</font>, <font color="MediumVioletRed">1.17.\*</font>, <font color="MediumVioletRed">1.18.\*</font> |
| <font color="DarkCyan">3.1.*</font> | <font color="MediumVioletRed">1.16.\*</font>, <font color="MediumVioletRed">1.17.\*</font>, <font color="MediumVioletRed">1.18.\*</font>, <font color="MediumVioletRed">1.19.\*</font> |
| <font color="DarkCyan">3.2.*</font> | <font color="MediumVioletRed">1.17.\*</font>, <font color="MediumVioletRed">1.18.\*</font>, <font color="MediumVioletRed">1.19.\*</font>, <font color="MediumVioletRed">1.20.\*</font> |
| <font color="DarkCyan">3.3.*</font> | <font color="MediumVioletRed">1.19.\*</font>, <font color="MediumVioletRed">1.20.\*</font> |

## Features

Expand Down
39 changes: 38 additions & 1 deletion docs/content.zh/docs/connectors/flink-sources/postgres-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,29 @@ Connector Options
so it does not need to be explicitly configured 'execution.checkpointing.checkpoints-after-tasks-finish.enabled' = 'true'
</td>
</tr>
<tr>
<td>scan.lsn-commit.checkpoints-num-delay</td>
<td>optional</td>
<td style="word-wrap: break-word;">3</td>
<td>Integer</td>
<td>The number of checkpoint delays before starting to commit the LSN offsets. <br>
The checkpoint LSN offsets will be committed in rolling fashion, the earliest checkpoint identifier will be committed first from the delayed checkpoints.
</td>
</tr>
</tbody>
</table>
</div>
<div>

Note: `slot.name` is recommended to set for different tables to avoid the potential `PSQLException: ERROR: replication slot "flink" is active for PID 974` error. See more [here](https://debezium.io/documentation/reference/1.9/connectors/postgresql.html#postgresql-property-slot-name).
### Notes

#### `slot.name` option

The `slot.name` is recommended to set for different tables to avoid the potential `PSQLException: ERROR: replication slot "flink" is active for PID 974` error. See more [here](https://debezium.io/documentation/reference/1.9/connectors/postgresql.html#postgresql-property-slot-name).

#### `scan.lsn-commit.checkpoints-num-delay` option

When consuming PostgreSQL logs, the LSN offset must be committed to trigger the log data cleanup for the corresponding slot. However, once the LSN offset is committed, earlier offsets become invalid. To ensure access to earlier LSN offsets for job recovery, we delay the LSN commit by `scan.lsn-commit.checkpoints-num-delay` (default value is `3`) checkpoints. This feature is available when config option `scan.incremental.snapshot.enabled` is set to true.

### Incremental Snapshot Options

Expand Down Expand Up @@ -521,6 +538,26 @@ public class PostgreSQLSourceExample {
}
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 PostgreSQL,Group 的名称会类似于 `test_database.test_schema.test_table`

Data Type Mapping
----------------

Expand Down
20 changes: 20 additions & 0 deletions docs/content.zh/docs/connectors/flink-sources/sqlserver-cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,26 @@ public class SqlServerIncrementalSourceExample {
}
```

### 可用的指标

指标系统能够帮助了解分片分发的进展, 下面列举出了支持的 Flink 指标 [Flink metrics](https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/):

| Group | Name | Type | Description |
|------------------------|----------------------------|-------|----------------|
| namespace.schema.table | isSnapshotting | Gauge | 表是否在快照读取阶段 |
| namespace.schema.table | isStreamReading | Gauge | 表是否在增量读取阶段 |
| namespace.schema.table | numTablesSnapshotted | Gauge | 已经被快照读取完成的表的数量 |
| namespace.schema.table | numTablesRemaining | Gauge | 还没有被快照读取的表的数据 |
| namespace.schema.table | numSnapshotSplitsProcessed | Gauge | 正在处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsRemaining | Gauge | 还没有被处理的分片的数量 |
| namespace.schema.table | numSnapshotSplitsFinished | Gauge | 已经处理完成的分片的数据 |
| namespace.schema.table | snapshotStartTime | Gauge | 快照读取阶段开始的时间 |
| namespace.schema.table | snapshotEndTime | Gauge | 快照读取阶段结束的时间 |

注意:
1. Group 名称是 `namespace.schema.table`,这里的 `namespace` 是实际的数据库名称, `schema` 是实际的 schema 名称, `table` 是实际的表名称。
2. 对于 SQLServer,Group 的名称会类似于 `test_database.test_schema.test_table`

Data Type Mapping
----------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,20 @@ Pipeline Connector Options
<td>Long</td>
<td>单个记录的最大大小(以byte为单位)。</td>
</tr>
<tr>
<td>sharding.suffix.key</td>
<td>optional</td>
<td style="word-wrap: break-word;">(none)</td>
<td>Long</td>
<td>每个表的分片后缀字段,允许为多个表设置分片后缀字段。默认 sink 表名为 test_table${suffix_key}。默认分片字段为第一个分区列。表之间用';'分隔。表和字段之间用':'分割。例如,我们设置 sharding.suffix.key 为'table1:col1;table2:col2'。</td>
</tr>
<tr>
<td>sharding.suffix.separator</td>
<td>optional</td>
<td style="word-wrap: break-word;">"_"</td>
<td>String</td>
<td>用于分割表名称和分片后缀的分隔符。默认是 '_'。如果设置为 '-',那么表名称会是 test_table-${suffix}。</td>
</tr>
</tbody>
</table>
</div>
Expand Down
Loading

0 comments on commit 49305e7

Please sign in to comment.