You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a test project to try out how the QueueStore<T> and the IQueue<T> works together, but even though I spent some time with it, I cannot get it to work as I expected. I uploaded the project here for reference.
Expected
I point to the QueueStore when defining the Config, set the Queue as unlimited and set the Queue's memory-limit option to an N number. Every time I add an object to my queue, Hazelcast should check If the Queue contains more entries currently than the specified limit. If TRUE, it should only add the object to the QueueStore, If FALSE, it should also add it to the Queue. Later, If the Queue entries leave the queue, and the size of the queue becomes less than the preset limit, It should reload entries from the QueueStore.
Experienced
The memory-limit setting is ignored and the entries are getting inserted into both the store and the queue, even If the limit is reached.
I will happily provide more information if needed.
The text was updated successfully, but these errors were encountered:
thanks for reporting this. Having a project with a reproducer is always a massive help!
I think the instances of SomeDataObj you are observing are actually retained by your QueueStore implementation not by Hazelcast.
The queue has all an entry per each item stored, but they do not hold a reference to your object. I believe the entries are stored to preserve ordering and they are fixed in size - regardless of your object size. See this:
You can see 5 entries (=your configured memory limit) retain 264 bytes each - because they also retain your domain object (SomeDataObj) whilst the remaining 95 entries have just 40 bytes - they are basically just an envelope, without the object itself.
I am closing the ticket for now, feel free to re-open it for further clarification.
Thanks @jerrinot, does this means, all the headers will be stored in every Node's Queue (as the Queue is not a partitioned implementation of the Map)? So If I would like to store a few million entries in my Queue (with a much lower memory-limit), I could still potentially overflow memory in some of my Nodes?
Also, If there is no data stored, how could I see the actual text values for objects where the id > 5? (See my screenshot).
The headers will be stored on 1+x nodes where x is your backup count (=1 by default)
You are right the queue is not partitioned. Instead a queue name is used to select a member owning the queue. All entries (envelopes) from this queue will be stored on the same member.
The envelope contains the item ID. The very same ID is used when storing an item into a queue store. When you call queue.poll() and the item is just an empty envolope then Hazelcast will invoke load(id) to load the payload from the store.
I made a test project to try out how the
QueueStore<T>
and theIQueue<T>
works together, but even though I spent some time with it, I cannot get it to work as I expected. I uploaded the project here for reference.Expected
I point to the
QueueStore
when defining theConfig
, set theQueue
as unlimited and set theQueue
'smemory-limit
option to anN
number. Every time I add an object to my queue, Hazelcast should check If the Queue contains more entries currently than the specified limit. IfTRUE
, it should only add the object to theQueueStore
, IfFALSE
, it should also add it to theQueue
. Later, If theQueue
entries leave the queue, and the size of the queue becomes less than the preset limit, It should reload entries from theQueueStore
.Experienced
The
memory-limit
setting is ignored and the entries are getting inserted into both the store and the queue, even If the limit is reached.I will happily provide more information if needed.
The text was updated successfully, but these errors were encountered: