You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Ilya Karpov <id...@gmail.com> on 2020/03/24 08:29:37 UTC

Importance of calling mapState.clear() when no entries in mapState

Hi,

given: 
- flink 1.6.1
- stateful function with MapState<K, V> mapState = //init logic;

Is there any reason I should call mapState.clear() if I know beforehand that there are no entries in mapState (e.g. mapState.iterator().hasNext() returns false)?

Thanks in advance!

Re: Importance of calling mapState.clear() when no entries in mapState

Posted by Dawid Wysakowicz <dw...@apache.org>.
I think there should be no reason to do that.

Best,

Dawid

On 24/03/2020 09:29, Ilya Karpov wrote:
> Hi,
>
> given: 
> - flink 1.6.1
> - stateful function with MapState<K, V> mapState = //init logic;
>
> Is there any reason I should call mapState.clear() if I know beforehand that there are no entries in mapState (e.g. mapState.iterator().hasNext() returns false)?
>
> Thanks in advance!