Skip to content

Commit 198b18c

Browse files
authored
Describe options of CDC-topic (#15306)
1 parent 3b555dc commit 198b18c

File tree

4 files changed

+46
-24
lines changed

4 files changed

+46
-24
lines changed

ydb/docs/en/core/concepts/cdc.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,29 @@ Currently, the ability to explicitly specify the number of topic partitions is a
247247

248248
You can add a changefeed to an existing table or erase it using the [ADD CHANGEFEED and DROP CHANGEFEED](../yql/reference/syntax/alter_table/changefeed.md) directives of the YQL `ALTER TABLE` statement. When erasing a table, the changefeed added to it is also deleted.
249249

250+
## Getting and Updating Topic Settings {#topic-settings}
251+
252+
You can get the settings using an [SDK](../reference/ydb-sdk/topic.md#describe-topic) or the [{{ ydb-short-name }} CLI](../reference/ydb-cli/commands/scheme-describe.md) by passing the path to the changefeed in the arguments, which has the following format:
253+
254+
```txt
255+
path/to/table/changefeed_name
256+
```
257+
258+
For example, if a table named `table` contains a changefeed named `updates_feed` in the `my` directory, its path looks as follows:
259+
260+
```text
261+
my/table/updates_feed
262+
```
263+
264+
The topic settings can be updated using the expression [ALTER TOPIC](../yql/reference/syntax/alter-topic.md). Supported actions:
265+
266+
* [updating settings](../yql/reference/syntax/alter-topic.md#updating-topic-settings):
267+
268+
* `retention_period`;
269+
* `retention_storage_mb`;
270+
271+
* [updating consumers](../yql/reference/syntax/alter-topic.md#updating-a-set-of-consumers).
272+
250273
## CDC Purpose and Use {#best_practices}
251274

252275
For information about using CDC when developing apps, see [best practices](../dev/cdc.md).

ydb/docs/en/core/dev/cdc.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@ CDC is represented as a data schema object: a changefeed that can be added to a
88

99
## Reading data from a topic {#read}
1010

11-
You can read data using an [SDK](../reference/ydb-sdk/index.md) or the [{{ ydb-short-name }} CLI](../reference/ydb-cli/index.md). As with any other data schema object, you can access a changefeed using its path that has the following format:
12-
13-
```txt
14-
path/to/table/changefeed_name
15-
```
16-
17-
For example, if a table named `table` contains a changefeed named `updates_feed` in the `my` directory, its path looks as follows:
18-
19-
```text
20-
my/table/updates_feed
21-
```
22-
2311
Before reading data, add a [consumer](../concepts/topic.md#consumer). Below is a sample command that adds a consumer named `my_consumer` to the `updates_feed` changefeed of the `table` table in the `my` directory:
2412

2513
```bash

ydb/docs/ru/core/concepts/cdc.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,29 @@ Change Data Capture (CDC) обеспечивает захват изменени
247247

248248
Поток изменений может быть добавлен к существующей таблице или удален директивами [ADD CHANGEFEED и DROP CHANGEFEED](../yql/reference/syntax/alter_table/changefeed.md) операции YQL `ALTER TABLE`. При удалении таблицы добавленный к ней поток изменений также будет удален.
249249

250+
## Получение и изменение параметров топика {#topic-options}
251+
252+
Для получения параметров топика можно воспользоваться [SDK](../reference/ydb-sdk/topic.md#describe-topic) или [{{ ydb-short-name }} CLI](../reference/ydb-cli/commands/scheme-describe.md), передав в аргументах путь до потока изменений, который формируется следующим образом:
253+
254+
```txt
255+
путь/до/строковой_таблицы/имя_потока_изменений
256+
```
257+
258+
>Например, если у строковой таблицы `table` в директории `my` есть поток изменений с именем `updates_feed`, то путь к нему будет выглядеть так:
259+
>
260+
>```text
261+
>my/table/updates_feed
262+
>```
263+
264+
Параметры топика могут быть изменены с использованием выражения [ALTER TOPIC](../yql/reference/syntax/alter-topic.md). Поддерживаемые действия:
265+
266+
* [изменение параметров](../yql/reference/syntax/alter-topic.md#alter-topic):
267+
268+
* `retention_period`;
269+
* `retention_storage_mb`;
270+
271+
* [управление читателями](../yql/reference/syntax/alter-topic.md#consumer).
272+
250273
## Назначение и применение CDC {#best_practices}
251274
252275
Об использовании CDC при разработке приложений смотрите в [рекомендациях](../dev/cdc.md).

ydb/docs/ru/core/dev/cdc.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ CDC представлен объектом схемы данных — пото
1010

1111
## Чтение из топика {#read}
1212

13-
Для чтения данных можно воспользоваться [SDK](../reference/ydb-sdk/) или [{{ ydb-short-name }} CLI](../reference/ydb-cli/). Как и к любому другому объекту схемы данных, к потоку изменений можно обратиться по его пути, который формируется следующим образом:
14-
15-
```txt
16-
путь/до/строковой_таблицы/имя_потока_данных
17-
```
18-
19-
>Например, если у строковой таблицы `table` в директории `my` есть поток изменений с именем `updates_feed`, то путь к нему будет выглядеть так:
20-
>
21-
>```text
22-
>my/table/updates_feed
23-
>```
24-
2513
Прежде чем приступить к чтению данных, необходимо добавить [потребителя данных (consumer)](../concepts/topic.md#consumer). Ниже приведен пример команды, которая добавит потребителя данных с именем `my_consumer` в поток данных с именем `updates_feed` строковой таблицы `table` в директории `my`:
2614

2715
```bash

0 commit comments

Comments
 (0)