Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Custom Eviction

I have an interesting problem to solve for evicting objects from the space: * Using non-persistent space * Using Processing Unit * Data objects placed into the space come from external system-of-record through various existing interfaces and some pre-processing takes place before writing them into the space. * Cached objects have parent-child relationship maintained via UID references. * Evicting a "parent" should trigger "cascade delete" on all of its children. * A "child" should never be individually evicted or data inconsistency will occur. * In majority of cases there will be no external event (like end-user interaction) to trigger object expiration before the lease expires.

Seems like "least-recently used" (LRU) eviction policy is suitable here but looks like the "parent-child" relationship described above makes it inappropriate to use the built-in LRU memory management.

What would be recommended implementation for developing custom eviction given the conditions above? Polling event container, worker (IWorker), something else?

The space appears to be maintaining a timestamp for the time when objects are written or updated. Is that "internal" timestamp accessible outside of the space engine? Maybe EntryInfo.m_TimeToLive/ExternalEntry.getTimeToLive()/IGSEntry.getTimeToLive() field can be used?

Thanks in advance!

/Vanio

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2345]{quote}

asked 2008-05-21 09:43:12 -0600

vanio gravatar image

updated 2013-08-08 09:52:00 -0600

jaissefsfex gravatar image
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

EntryInfo.m_TimeToLive/ExternalEntry.getTimeToLive()/IGSEntry.getTimeToLive() means the time left for the entry to leave within the space before it expires.

Please note a space running using the ExternalDataSoruce would not honor the lease time specified with the write operation. The object would not be expired and would not be evicted from the space.

Shay

answered 2008-05-21 10:49:02 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Hi Shay,

The "Memory Management" doc on the wiki explains that in case of least-recently-used policy (quote) "...the space evicts the "oldest" Entries from its memory. "Oldest" Entries are determined by the time they were written or updated to the space".

  • Is the "access" timestamp updated for "read" operations too?

  • Is the entries' "access" timestamp accessible somehow?

Thank you for the insights!

Thanks, Vanio

vanio gravatar imagevanio ( 2008-05-22 08:49:12 -0600 )edit
0

Vanio, Shay alerted me about this post. I host the Custom Eviction project.

Your use-case if perfect fit for Custom Eviction and I think this approach should be able to solve your problem easily.

Currently the eviction project is not available as a PU. You should be able to make this change without much effort. I will be glad to help you if you are considering using this approach.

Feel free to contact me if you have any questions.

Thanks Sean

answered 2008-05-21 10:51:21 -0600

edit flag offensive delete link more

Comments

Yes, Sean, I am interested in exploring if the Custom Eviction project can be used as the foundation for custom eviction implementation for my problem.

Thank you for offering to help - I'll look at the source code and will most certainly contact you in case questions come up.

Thanks, Vanio

vanio gravatar imagevanio ( 2008-05-22 08:26:22 -0600 )edit

Vanio, Here is my email id to reach me quickly, seank@gigaspaces.com . I don't participate in this forum as actively as Shay and other Giga gang and there may be delay in responding to the forum posts

Sean

skpabba gravatar imageskpabba ( 2008-05-22 22:37:13 -0600 )edit
0

Vanio, We will provide an interface allowing users to build custom eviction plug-in in future releases for the space. There is such for Local Cache Map API.

For now the following should be used as a skeleton to implement such space custom eviction: http://openspaces.org/display/PEN/Cus... Shay

answered 2008-05-21 10:11:37 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-05-21 09:43:12 -0600

Seen: 63 times

Last updated: May 21 '08