What's the difference between ClientCache#removeAll() and ClientCache#clear()

classic Classic list List threaded Threaded
5 messages Options
kcheng.mvp kcheng.mvp
Reply | Threaded
Open this post in threaded view
|

What's the difference between ClientCache#removeAll() and ClientCache#clear()

Here is the code snippet from
org.apache.ignite.client.ClientCache

what's the difference between these two methods?

*****************************************************
    /**
     * Clears the contents of the cache.
     */
    public void clear() throws ClientException;



    /**
     * Removes all of the mappings from this cache.
     * <p>
     * The order that the individual entries are removed is undefined.
     */
    public void removeAll() throws ClientException;

*****************************************************







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: What's the difference between ClientCache#removeAll() and ClientCache#clear()

Hello!

Clear will not notify cache listeners or CacheWriters, but removeAll() will.

This is as per IgniteCache doc (which I guess is underlying here).

Regards,
--
Ilya Kasnacheev


пт, 26 апр. 2019 г. в 05:10, kcheng.mvp <[hidden email]>:
Here is the code snippet from
org.apache.ignite.client.ClientCache

what's the difference between these two methods?

*****************************************************
    /**
     * Clears the contents of the cache.
     */
    public void clear() throws ClientException;



    /**
     * Removes all of the mappings from this cache.
     * <p>
     * The order that the individual entries are removed is undefined.
     */
    public void removeAll() throws ClientException;

*****************************************************







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
kcheng.mvp kcheng.mvp
Reply | Threaded
Open this post in threaded view
|

Re: What's the difference between ClientCache#removeAll() and ClientCache#clear()

image.png

There is no java doc about this. Anyway thank you very much!


Thanks,
Ken Cheng


On Fri, Apr 26, 2019 at 7:52 PM Ilya Kasnacheev <[hidden email]> wrote:
Hello!

Clear will not notify cache listeners or CacheWriters, but removeAll() will.

This is as per IgniteCache doc (which I guess is underlying here).

Regards,
--
Ilya Kasnacheev


пт, 26 апр. 2019 г. в 05:10, kcheng.mvp <[hidden email]>:
Here is the code snippet from
org.apache.ignite.client.ClientCache

what's the difference between these two methods?

*****************************************************
    /**
     * Clears the contents of the cache.
     */
    public void clear() throws ClientException;



    /**
     * Removes all of the mappings from this cache.
     * <p>
     * The order that the individual entries are removed is undefined.
     */
    public void removeAll() throws ClientException;

*****************************************************







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Dmitriy Pavlov Dmitriy Pavlov
Reply | Threaded
Open this post in threaded view
|

Re: What's the difference between ClientCache#removeAll() and ClientCache#clear()

Hi Ken, 

please feel free to create and PR and ticket for updating this. 

Sincerely,
Dmitriy Pavlov

пт, 26 апр. 2019 г. в 18:22, Ken Cheng <[hidden email]>:
image.png

There is no java doc about this. Anyway thank you very much!


Thanks,
Ken Cheng


On Fri, Apr 26, 2019 at 7:52 PM Ilya Kasnacheev <[hidden email]> wrote:
Hello!

Clear will not notify cache listeners or CacheWriters, but removeAll() will.

This is as per IgniteCache doc (which I guess is underlying here).

Regards,
--
Ilya Kasnacheev


пт, 26 апр. 2019 г. в 05:10, kcheng.mvp <[hidden email]>:
Here is the code snippet from
org.apache.ignite.client.ClientCache

what's the difference between these two methods?

*****************************************************
    /**
     * Clears the contents of the cache.
     */
    public void clear() throws ClientException;



    /**
     * Removes all of the mappings from this cache.
     * <p>
     * The order that the individual entries are removed is undefined.
     */
    public void removeAll() throws ClientException;

*****************************************************







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
kcheng.mvp kcheng.mvp
Reply | Threaded
Open this post in threaded view
|

Re: What's the difference between ClientCache#removeAll() and ClientCache#clear()


On Fri, Apr 26, 2019 at 11:26 PM Dmitriy Pavlov <[hidden email]> wrote:
Hi Ken, 

please feel free to create and PR and ticket for updating this. 

Sincerely,
Dmitriy Pavlov

пт, 26 апр. 2019 г. в 18:22, Ken Cheng <[hidden email]>:
image.png

There is no java doc about this. Anyway thank you very much!


Thanks,
Ken Cheng


On Fri, Apr 26, 2019 at 7:52 PM Ilya Kasnacheev <[hidden email]> wrote:
Hello!

Clear will not notify cache listeners or CacheWriters, but removeAll() will.

This is as per IgniteCache doc (which I guess is underlying here).

Regards,
--
Ilya Kasnacheev


пт, 26 апр. 2019 г. в 05:10, kcheng.mvp <[hidden email]>:
Here is the code snippet from
org.apache.ignite.client.ClientCache

what's the difference between these two methods?

*****************************************************
    /**
     * Clears the contents of the cache.
     */
    public void clear() throws ClientException;



    /**
     * Removes all of the mappings from this cache.
     * <p>
     * The order that the individual entries are removed is undefined.
     */
    public void removeAll() throws ClientException;

*****************************************************







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/