You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SDK supports two topic reading modes with autoscaling enabled: full support mode and compatibility mode. The reading mode can be setin the `auto_partitioning_support` argument when creating the reader. Full support mode is used by default.
1993
+
1994
+
```python
1995
+
reader = driver.topic_client.reader(
1996
+
topic,
1997
+
consumer,
1998
+
auto_partitioning_support=True, # Full support is enabled
1999
+
)
2000
+
2001
+
# or
2002
+
2003
+
reader = driver.topic_client.reader(
2004
+
topic,
2005
+
consumer,
2006
+
auto_partitioning_support=False, # Compatibility mode is enabled
2007
+
)
2008
+
```
2009
+
2010
+
From a practical perspective, these modes do not differ for the end user. However, the full support mode differs from the compatibility mode in terms of who guarantees the order of reading—the client or the server. Compatibility mode is achieved through server-side processing and generally operates slower.
Copy file name to clipboardExpand all lines: ydb/docs/ru/core/reference/ydb-sdk/topic.md
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1999,4 +1999,57 @@
1999
1999
2000
2000
Рекомендуется проверять корректность обработки мягкого прерывания чтения: клиент должен обработать полученные сообщения, подтвердить их обработку (коммит) или сохранить позицию чтения в своей базе, и только после этого вызывать `Confirm()` для события `TStopPartitionSessionEvent`.
2001
2001
2002
+
- Python
2003
+
2004
+
Включение автомасштабирования топика во время его создания производится с помощью аргумента `auto_partitioning_settings` у `create_topic`:
SDK поддерживает два режима чтения топиков с включенным автомасштабированием: режим полной поддержки и режим совместимости. Режим чтения задаётся аргументом `auto_partitioning_support` во время создания читателя. По умолчанию используется режим полной поддержки.
2036
+
2037
+
```python
2038
+
reader = driver.topic_client.reader(
2039
+
topic,
2040
+
consumer,
2041
+
auto_partitioning_support=True, # Full support is enabled
2042
+
)
2043
+
2044
+
# or
2045
+
2046
+
reader = driver.topic_client.reader(
2047
+
topic,
2048
+
consumer,
2049
+
auto_partitioning_support=False, # Compatibility mode is enabled
2050
+
)
2051
+
```
2052
+
2053
+
С практической точки зрения для конечного пользователя режимы не отличаются. Режим полной поддержки отличается от режима совместимости тем, кто гарантирует порядок чтения — клиент или сервер. Режим совместимости достигается серверной обработкой и, как правило, работает медленнее.
0 commit comments