flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] azagrebin commented on a change in pull request #6379: [FLINK-9637] Add public user documentation for state TTL feature
Date Fri, 03 Aug 2018 13:03:18 GMT
azagrebin commented on a change in pull request #6379: [FLINK-9637] Add public user documentation
for state TTL feature
URL: https://github.com/apache/flink/pull/6379#discussion_r207537238
 
 

 ##########
 File path: docs/dev/stream/state/state.md
 ##########
 @@ -266,6 +266,92 @@ a `ValueState`. Once the count reaches 2 it will emit the average and
clear the
 we start over from `0`. Note that this would keep a different state value for each different
input
 key if we had tuples with different values in the first field.
 
+### State time-to-live (TTL)
+
+A time-to-live (TTL) can be assigned to the keyed state value. 
+In this case it will expire after the configured TTL
+and its stored value will be cleaned up based on the best effort.
+Depending on configuration, the expired state can become unavailable for read access
+even if it is not cleaned up yet. In this case it behaves as if it does not exist any more.
+
+The collection types of state support TTL on entry level: 
+separate list elements and map entries expire independently. 
+
+The behaviour of state with TTL firstly should be configured by building `StateTtlConfiguration`:
+
+<div class="codetabs" markdown="1">
+<div data-lang="java" markdown="1">
+{% highlight java %}
+StateTtlConfiguration ttlConfig = StateTtlConfiguration
+    .newBuilder(Time.seconds(1))
+    .setTtlUpdateType(StateTtlConfiguration.TtlUpdateType.OnCreateAndWrite)
 
 Review comment:
   Agree, I added the renaming commit in PR #6460 for FLINK-9938.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message