General Questions

Expand all | Collapse all

What's the difference between cache event types

Jump to Best Answer
  • 1.  What's the difference between cache event types

     
    Posted 07-06-2019 08:51 AM
    I'm looking to use a node local listener against one or more caches.

    What is the difference between EVT_CACHE_ENTRY_CREATED and EVT_CACHE_OBJECT_PUT ?

    I'm interested in a local listener that reacts to cache changes, specifically when an entry is added, modified or deleted.

    Also, what is the difference between the EVTCACHE_ENTRY and the EVTCACHE_OBJECT notifications?
    Thank you

    ------------------------------
    George Landow
    software engineer
    private
    ------------------------------


  • 2.  RE: What's the difference between cache event types

     
    Posted 07-08-2019 07:28 AM
    I think you need EVT_CACHE_OBJECT_PUT event for this purpose. You can always evaluate CacheEvent.oldValue to decide if the entry is new or is being updated (new entries will have old value set to null)


  • 3.  RE: What's the difference between cache event types

     
    Posted 07-08-2019 07:31 AM
    Thanks Mikey, I understand that part now. But what is the difference between the EVTCACHE_ENTRY and the EVTCACHE_OBJECT notifications?

    ------------------------------
    George Landow
    software engineer
    private
    ------------------------------



  • 4.  RE: What's the difference between cache event types
    Best Answer

    Posted 07-08-2019 07:41 AM
    Hello!

    I think the difference is that EVT_CACHE_ENTRY_CREATED is only fired when key is added to cache, but not for value modifications of already existing keys. EVT_CACHE_OBJECT_PUT will fire for every update of value.

    Regards,

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



Would you attend a July Meetup?


Announcements