wuchong commented on a change in pull request #8341: [FLINK-11633][docs-zh]
Translate "Working with state" into Chinese
URL: https://github.com/apache/flink/pull/8341#discussion_r281010149
##########
File path: docs/dev/stream/state/state.zh.md
##########
@@ -394,30 +338,25 @@ val ttlConfig = StateTtlConfig
</div>
</div>
-This option is not applicable for the incremental checkpointing in the RocksDB
state backend.
+这个配置对 RocksDB 增量 checkpoint 无效。
-**Notes:**
-- For existing jobs, this cleanup strategy can be activated or deactivated
anytime in `StateTtlConfig`,
-e.g. after restart from savepoint.
+**注意:**
+- 这种清理方式可以在任何时候通过 `StateTtlConfig` 启用或者关闭,比如在从 savepoint 恢复时。
-##### Incremental cleanup
+##### 增量数据清理
-Another option is to trigger cleanup of some state entries incrementally.
-The trigger can be a callback from each state access or/and each record
processing.
-If this cleanup strategy is active for certain state,
-The storage backend keeps a lazy global iterator for this state over all its
entries.
-Every time incremental cleanup is triggered, the iterator is advanced.
-The traversed state entries are checked and expired ones are cleaned up.
+另外可以选择增量式清理状态数据,在状态访问或/和处理时进行。如果某个状态开启了该清理策略,则会在存储后端保留一个所有状态的惰性全局迭代器。
+每次触发增量清理时,从迭代器中选择已经过期的数进行清理。
-This feature can be activated in `StateTtlConfig`:
+该特性可以通过 `StateTtlConfig` 进行启用:
<div class="codetabs" markdown="1">
<div data-lang="java" markdown="1">
{% highlight java %}
import org.apache.flink.api.common.state.StateTtlConfig;
StateTtlConfig ttlConfig = StateTtlConfig
.newBuilder(Time.seconds(1))
- .cleanupIncrementally()
+ .cleanupIncrementally(10, true)
Review comment:
Please also update scala example and `state.md`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services