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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

idkfaon
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!
Reply | Threaded
Open this post in threaded view
|

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

Dawid Wysakowicz-2
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!


signature.asc (849 bytes) Download Attachment