Hello! You can extend RendezvousAffinityFunction overriding partition(Object) method, pass an instance of such affinity function in those caches' configurations.
Regards, -- Ilya Kasnacheev 2018-07-26 16:01 GMT+03:00 Maxim Malygin <[email protected]>: > Hi, > > I'd like to keep some set of caches together. In other words, I need that > all elements of, for example, cache1 and cache2 were collocated to one node. > I can do it by adding some additional field to their keys and initialize > it with the same constant value for all caches. But I don't want keep this > additional field as part of key because it will eat additional memory and > will do my code more complex. > > Is it possible to do it without an additional field in keys? > I know there is AffinityKeyMapper which can be configured in > CacheConfiguration but it's marked as deprecated in 2.6.0. > > Thanks, > Maxim >
