azagrebin commented on a change in pull request #8459: [FLINK-12476] [State 
TTL] Consider setting a default background cleanup strategy in StateTtlConfig
URL: https://github.com/apache/flink/pull/8459#discussion_r285595149
 
 

 ##########
 File path: docs/dev/stream/state/state.md
 ##########
 @@ -400,6 +400,37 @@ This option is not applicable for the incremental 
checkpointing in the RocksDB s
 - For existing jobs, this cleanup strategy can be activated or deactivated 
anytime in `StateTtlConfig`, 
 e.g. after restart from savepoint.
 
+#### Cleanup in background
+
+Besides cleanup in full snapshot, you also can activate the cleanup in 
background. The option will adapt
+all the cleanup strategies with default values. Users who do not need to think 
about details or used backend.
+Currently, Flink provide two kind of cleanup strategies in background and the 
default config value list below:
+
+This feature can be activated in `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))
+    .cleanupInBackground()
+    .build();
+{% endhighlight %}
+</div>
+ <div data-lang="scala" markdown="1">
+{% highlight scala %}
+import org.apache.flink.api.common.state.StateTtlConfig
+val ttlConfig = StateTtlCon fig
+    .newBuilder(Time.seconds(1))
+    .cleanupInBackground()
+    .build
+{% endhighlight %}
+</div>
+</div>
+
+For more fine-grained control over some special cleanup in background, you can 
configure it separately as described below.
 
 Review comment:
   Let's also add:
   `Currently, heap state backend relies on incremental cleanup and RocksDB 
backend uses compaction filter for background cleanup.`

----------------------------------------------------------------
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

Reply via email to