You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by Snehal Khanna <sn...@yahoo.com> on 2003/12/04 19:27:01 UTC

Key types supported in MRUMemoryCache

Does anyone know why the update method of
MRUMemoryCache expects keys to be of type String?

This is the code I am referring to:
synchronized ( lockMe )
{
   map.put( key, ce );
   if ( replace )
   {
     // the slowest method I've ever seen
     mrulist.remove( ( String ) key );
   }
   mrulist.addFirst( ( String ) key );
}

Thanks,
Snehal

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org


RE: Key types supported in MRUMemoryCache

Posted by Aaron Smuts <aa...@wisc.edu>.
LRY uses a double linked list that is extremely efficient.  It couldn't
be any faster.

Aaron

> -----Original Message-----
> From: Snehal Khanna [mailto:snehal_haridas@yahoo.com]
> Sent: Thursday, December 04, 2003 2:01 PM
> To: Turbine JCS Users List
> Subject: RE: Key types supported in MRUMemoryCache
> 
> Thanks Aaron. A follow up question. MRUMemoryCache
> uses a LinkedList whereas LRUMemoryCache implements
> its own linked list using MemoryElementDescritor
> types.
> 
> Any reason why LRU manager does not use LinkedList?
> 
> Thanks
> Snehal
> 
> --- Aaron Smuts <aa...@wisc.edu> wrote:
> > The MRU memory manager is a sample of how to build
> > another memory plugin
> > if you so desired.  The LRU should be used, the one
> > configured in all
> > the sample configuration files.
> >
> > Aaron
> >
> > > -----Original Message-----
> > > From: Snehal Khanna
> > [mailto:snehal_haridas@yahoo.com]
> > > Sent: Thursday, December 04, 2003 12:27 PM
> > > To: JCS
> > > Subject: Key types supported in MRUMemoryCache
> > >
> > > Does anyone know why the update method of
> > > MRUMemoryCache expects keys to be of type String?
> > >
> > > This is the code I am referring to:
> > > synchronized ( lockMe )
> > > {
> > >    map.put( key, ce );
> > >    if ( replace )
> > >    {
> > >      // the slowest method I've ever seen
> > >      mrulist.remove( ( String ) key );
> > >    }
> > >    mrulist.addFirst( ( String ) key );
> > > }
> > >
> > > Thanks,
> > > Snehal
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Protect your identity with Yahoo! Mail
> > AddressGuard
> > > http://antispam.yahoo.com/whatsnewfree
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > turbine-jcs-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > turbine-jcs-user-help@jakarta.apache.org
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > turbine-jcs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > turbine-jcs-user-help@jakarta.apache.org
> >
> 
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
turbine-jcs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
turbine-jcs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org


RE: Key types supported in MRUMemoryCache

Posted by Snehal Khanna <sn...@yahoo.com>.
Thanks Aaron. A follow up question. MRUMemoryCache
uses a LinkedList whereas LRUMemoryCache implements
its own linked list using MemoryElementDescritor
types.

Any reason why LRU manager does not use LinkedList?

Thanks
Snehal

--- Aaron Smuts <aa...@wisc.edu> wrote:
> The MRU memory manager is a sample of how to build
> another memory plugin
> if you so desired.  The LRU should be used, the one
> configured in all
> the sample configuration files.
> 
> Aaron
> 
> > -----Original Message-----
> > From: Snehal Khanna
> [mailto:snehal_haridas@yahoo.com]
> > Sent: Thursday, December 04, 2003 12:27 PM
> > To: JCS
> > Subject: Key types supported in MRUMemoryCache
> > 
> > Does anyone know why the update method of
> > MRUMemoryCache expects keys to be of type String?
> > 
> > This is the code I am referring to:
> > synchronized ( lockMe )
> > {
> >    map.put( key, ce );
> >    if ( replace )
> >    {
> >      // the slowest method I've ever seen
> >      mrulist.remove( ( String ) key );
> >    }
> >    mrulist.addFirst( ( String ) key );
> > }
> > 
> > Thanks,
> > Snehal
> > 
> > __________________________________
> > Do you Yahoo!?
> > Protect your identity with Yahoo! Mail
> AddressGuard
> > http://antispam.yahoo.com/whatsnewfree
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> turbine-jcs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> turbine-jcs-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> turbine-jcs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> turbine-jcs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org


RE: Key types supported in MRUMemoryCache

Posted by Aaron Smuts <aa...@wisc.edu>.
The MRU memory manager is a sample of how to build another memory plugin
if you so desired.  The LRU should be used, the one configured in all
the sample configuration files.

Aaron

> -----Original Message-----
> From: Snehal Khanna [mailto:snehal_haridas@yahoo.com]
> Sent: Thursday, December 04, 2003 12:27 PM
> To: JCS
> Subject: Key types supported in MRUMemoryCache
> 
> Does anyone know why the update method of
> MRUMemoryCache expects keys to be of type String?
> 
> This is the code I am referring to:
> synchronized ( lockMe )
> {
>    map.put( key, ce );
>    if ( replace )
>    {
>      // the slowest method I've ever seen
>      mrulist.remove( ( String ) key );
>    }
>    mrulist.addFirst( ( String ) key );
> }
> 
> Thanks,
> Snehal
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
turbine-jcs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
turbine-jcs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-user-help@jakarta.apache.org