Thank JING.

But I have a question here, what will happen to the keyed stream in that
case?  Will it be removed automatically? or will be present but the state
will be empty, in that case what is the implication on memory occupation?

On Tue, Aug 31, 2021 at 8:14 AM JING ZHANG <beyond1...@gmail.com> wrote:

> Hi,
> All types of state also have a method clear() that clears the state for
> the currently active key, i.e. the key of the input element.
> Could we call the `clear()` method directly to remove the state under the
> specified key?
>
> Best,
> JING ZHANG
>
>
> narasimha <swamy.haj...@gmail.com> 于2021年8月31日周二 上午9:44写道:
>
>> Hi,
>>
>> I have a use case where the keyed state is managed (create, reset) by
>> dynamically changing rules. New action "delete" has to be added.
>> Delete is to completely delete the keyed state, same as how StateTTL does
>> post expiration time.
>>
>> Use StateTTL?
>>
>> Initially used StateTTL, but it ended up in increasing the CPU usage even
>> with low traffic.
>> The state gets updated ~>50 times a second, and read multiple times in a
>> second, so the time against state entry is getting updated often.
>>
>> So I didn't find it to be a viable solution.
>>
>> Can someone please help on how Keyed State can be removed outside of
>> StateTTL.
>>
>> --
>> A.Narasimha Swamy
>>
>

-- 
A.Narasimha Swamy

Reply via email to