Priority Queue comparator class com.hazelcast.collection.impl.queue.model.PriorityElementComparator does not exists in hazecast-4.2.2-all.jar

21 views
Skip to first unread message

Rakesh Sharma

unread,
Feb 23, 2023, 9:05:58 PM2/23/23
to Hazelcast
As per Hazelcast 4.2.2 docs:  we can add  priority-comparator-class-name as com.hazelcast.collection.impl.queue.model.PriorityElementComparator

<queue name="default"> <max-size>10</max-size> <backup-count>1</backup-count> <item-listeners> <item-listener include-value="true">com.hazelcast.examples.ItemListener</item-listener> </item-listeners> <queue-store> <class-name>com.hazelcast.QueueStoreImpl</class-name> <properties> <property name="binary">false</property> <property name="memory-limit">10000</property> <property name="bulk-load">500</property> </properties> </queue-store> <priority-comparator-class-name>com.hazelcast.collection.impl.queue.model.PriorityElementComparator</priority-comparator-class-name> </queue>


But com.hazelcast.collection.impl.queue.model.PriorityElementComparator
does not exists in hazelcast-all-4.2.2.jar we took from https://mvnrepository.com/artifact/com.hazelcast/hazelcast-all/4.2.2

From where I can get that java class? There are no example for PriorityQueue usage anywhere. It will be helpful if we can get an example how to use it end to end.

Thanks,
Rakesh

jo...@hazelcast.com

unread,
Feb 28, 2023, 6:50:05 AM2/28/23
to Hazelcast
Hi Rakesh,

the PriorityElementComparator class is just a sample name. You'll provide your own implementation of java.util.Comparator interface and use its fully qualified class name as the priority-comparator-class-name value.

As an example, you can find the class mentioned by you in hazelcast tests:

Regards,

-- Josef

Reply all
Reply to author
Forward
0 new messages