Setting eviction policies on Spring Data Hazelcast plugin

74 views
Skip to first unread message

gabron

unread,
Aug 27, 2021, 4:06:40 PM8/27/21
to Hazelcast
I recently started a new project using the Spring Data Hazelcast plugin.  I'm able to setup a demo project where I can successfully create and use Hazelcast Repositories according to the spring data standard.  I was also able to use the same HazelcastInstance that is embeeded in the spring boot project to create maps and other distributed data structures.

My question is this, I can't seem to find documentation on what backs the hazelcast spring data repositories, that is what data structure, and I can't seem to figure out how to set any properties that would allow me to control the eviction of items that get saved via the repository API.  

How would I go about limiting the overall hazelcast instance size, and can I set restrictions per repository?

An example of this would be I have a TeacherRepository and a StudentRepository and I would like to set a lower max size for the TeacherRepository, and then set a different TTL for the StudentRepository.

I assumed that these would be persisted to separate maps with separate configurations, I just can't seem to find information on how you access them and configure them.  Is this accomplished with the Config object that gets initialized by the spring context?

thanks

Neil Stevenson

unread,
Aug 31, 2021, 3:34:45 AM8/31/21
to haze...@googlegroups.com
For Spring-Data-Hazelcast the "@Repository" objects are backed by IMaps

If you use Management Center against a small cluster you can see them being created, how many objects are in them, etc.

IMaps are created on demand, when you access a Spring-Data-Hazelcast repository for the first time, the map would be created using the configuration.

All you should need do is provide standard IMap configuration to get eviction, expiry or whatever you want.

Neil

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/e75a0c45-c759-4d9e-99a3-1f2040c0a0a0n%40googlegroups.com.

This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast
Reply all
Reply to author
Forward
0 new messages