Quantcast
Viewing all articles
Browse latest Browse all 3

Is the flink MapState's TTL for the whole MapState instance or for each element in the MapState

I have a MapState in flink. And I set the ttl to 10 minutes. Is the ttl for the whole MapState instance or for each of the elements?

    val ttlConfig = StateTtlConfig
      .newBuilder(Time.minutes(10))
      .setUpdateType(StateTtlConfig.UpdateType.OnCreateAndWrite)
      .setStateVisibility(StateTtlConfig.StateVisibility.NeverReturnExpired)
      .build

      val myMapState: MapState[String, Upload] = ....

      myMapState.put("a", "x")

      // 5 minutes later
      myMapState.put("b", "y")

      // Again 6 minutes later, is the myMapState still available? 
      // I assume myMapState is still available and it still has key "b" for 4 minutes. Is that correct?




Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>