Re: SortedEvictionPolicy doesn't work as expected

2018-03-02 Thread mamaco
Everything is clear now, our product version is ignite 1.7, now considering 2.3 migration, the whole conversation is very important to us, especially the key point of how Off-Heap works. Thank you so much. Marco Denis Mekhanikov wrote > No, It's not like that. > > You can access any entry from

Re: SortedEvictionPolicy doesn't work as expected

2018-02-28 Thread Denis Mekhanikov
No, It's not like that. You can access any entry from any node, but access time will be different. If an entry is stored on a different node, Ignite will make a network request to that node and return it to you. If the entry is available locally, then the access time will be lower. And if you conf

Re: SortedEvictionPolicy doesn't work as expected

2018-02-28 Thread mamaco
So, that means even if I have a local cache with SortedEvictionPolicy configured and OnHeap enabled, it's still impossible to get the entries from a distributed partition cache, because the source cache is not centralized. And finally, the solution is to set a standalone SortedMap via RemoteEventL

Re: SortedEvictionPolicy doesn't work as expected

2018-02-28 Thread Denis Mekhanikov
Marco, If you access some records, that are stored in the off-heap memory, then you have to wait, while Ignite is deserializing the data and copying it to Java heap. But if the needed entry is already available in Java heap, Ignite doesn't have to perform these steps to return the result, it can j

Re: SortedEvictionPolicy doesn't work as expected

2018-02-28 Thread mamaco
Hi Denis, Thank you for the response, I appreciate it. Yes, I agree with you, it could be done by various solutions, 'REST', 'Event Listener' or any standalone instance. According to the new design you mentioned, ignite stop the support of '/setMemoryMode(CacheMemoryMode.ONHEAP_TIERED)/' use Off-

Re: SortedEvictionPolicy doesn't work as expected

2018-02-28 Thread Denis Mekhanikov
Marco, There is no way to perform "get" operations on heap entries solely, as far as I know. Looks like you are trying to miss-use a Java heap cache. What you need can be achieved by using some tree data structure like Java TreeSet. Every time you insert something into cache, you can update this

Re: SortedEvictionPolicy doesn't work as expected

2018-02-27 Thread mamaco
After reading valentin's example and a user discussion

Re: SortedEvictionPolicy doesn't work as expected

2018-02-27 Thread mamaco
Hi Denis, Thank you for the explanation, so the cause is about Ignite use both of on-heap and off-heap to store the entries and unfortunately I read the everything from off-heap, so question #1 is: *how could I read the on-heap entries directly?* *My use case* is to get Top 100 entries by sorting

Re: SortedEvictionPolicy doesn't work as expected

2018-02-27 Thread Denis Mekhanikov
Hi! Eviction policy specifies, which entries should be kept in on-heap memory in deserialized format. So, the access time will be the lowest for such entries, when read from the local node. But such entries are stored twice: once in off-heap and once in on-heap. And evicted entries are stored in o

SortedEvictionPolicy doesn't work as expected

2018-02-26 Thread mamaco
Here I have a five entries as below: (14,4); (21,1); (32,2); (113,3); (15,5); and I want to use SortedEvictionPolicy to keep below 3 entries (sort by values in descending order and get top 3 items): 15-->5 14-->4 113-->3 The actual output is: 21-->1 32-->2 113-->3 14-->4 15-->5 issue 1: The orde