-
1. Re: FIFO Ordering
manik Feb 20, 2009 6:18 AM (in response to imbng)Not really - the eviction algorithm is implemented as a linked list which links node Fqns as they are entered in the cache and processed on one end of the list.
What the previous thread was about was ordering attributes in a node. -
2. Re: FIFO Ordering
imbng Feb 20, 2009 9:54 AM (in response to imbng)So, sounds like if we wanted to FIFO process work as it enters the cache we'd have to roll our own.
Maybe by keeping track FIFO order in another node as you do for FIFO eviction and use it as our key structure to retrieve the nodes in the correct order. Something like that?
Is adding FIFO ordering to Nodes on any upcoming roadmaps? This would be a big piece of our system.
Thanks -
3. Re: FIFO Ordering
genman Feb 20, 2009 3:24 PM (in response to imbng)Manik, There should be some way to create FIFO nodes using a different implementation of Node Factory.
-
4. Re: FIFO Ordering
imbng Feb 20, 2009 4:48 PM (in response to imbng)Hmm, sounds interesting...if that works how would I get the next in the list from the cache. There doesn't appear to be a getNext or get with no param.
-
5. Re: FIFO Ordering
manik Feb 23, 2009 4:58 AM (in response to imbng)"genman" wrote:
Manik, There should be some way to create FIFO nodes using a different implementation of Node Factory.
Possibly, but at the moment it isn't configurable and there is no way to inject a custom node factory - unless you want to hack the ComponentRegistry and do a re-wire. Using different Map types in each Node is something we have been considering but there is a cost attached to using ordered maps everywhere (especially since with MVCC there is a lot of copying of maps going on, hence our FastCopyHashMap implementation). With ordering, this becomes even more expensive.
And even if we were to only use ordered maps for certain nodes to limit the impact, there is an issue of how this is specified. Declaratively, by specifying certain subtrees to be ordered? Or programmatically, via Node.addChild() and Node.addOrderedChild()? Or Node.makeOrdered()? The programmatic approach also impacts cache loaders and replication since these method invocations would need to be replicated to make sure the node is ordered across a cluster and a flag persisted with the node data in cache loaders, breaking all existing cache loaders.
So it isn't nearly as trivial as you think. :-)