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_r290168733
 
 

 ##########
 File path: docs/dev/stream/state/state.md
 ##########
 @@ -400,6 +400,35 @@ 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 can also activate the cleanup in 
background. The following option 
+will activate a default background cleanup in StateTtlConfig if it is 
supported for the used backend:
+
+<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
 
 Review comment:
   remove space `StateTtlCon fig` -> `StateTtlConfig`

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