Re: ??:Re: Meeting trouble when modifying LRU algorithm.

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 10 Apr 2002 18:22:21 +0200

If you have added your key function to the list below then your new
policy name is

  heap Gorge_LRU

Regards
Henrik

maer727@sohu.com wrote:
>
> Thanks, Henrik pal!
>
> I still have a question. After adding my own algorithm, ( suppose my keytype is
> George_LRU ), I think I must let Squid know that four keytypes now, ( LRU, GDSF, LFUDA,
> George_LRU ).
>
> But how to tell Squid that a new algorithm (keytype) has been registered? Using squid.conf?
>
> Best regards,
> George, Ma
>
> /////////////////////////////////////////////////////////////////
> Just add it somewhere before the final "Uknown...".
>
> You also need to declare a prototype in the .h file.
>
> Regards
> Henrik
>
> On Wednesday 10 April 2002 05:06, maer727@sohu.com wrote:
> > Thanks, Henrik pal!
> >
> > Thanks for your suggestions. It is very useful.
> >
> > Such are the codes taken from store_repl_heap.c:
> > createRemovalPolicy_heap
> >
> > ///////////////////////////////////////////////////////////////////
> >///// if (!strcmp(keytype, "GDSF"))
> > heap_data->keyfunc = HeapKeyGen_StoreEntry_GDSF;
> > else if (!strcmp(keytype, "LFUDA"))
> > heap_data->keyfunc = HeapKeyGen_StoreEntry_LFUDA;
> > else if (!strcmp(keytype, "LRU"))
> > heap_data->keyfunc = HeapKeyGen_StoreEntry_LRU;
> > else {
> > debug(81, 0) ("createRemovalPolicy_heap: Unknown key type \"%s\".
> > Using LRU\n", keytype);
> > heap_data->keyfunc = HeapKeyGen_StoreEntry_LRU;
> > }
> > ///////////////////////////////////////////////////////////////////
> >//////// If I have developed a algorithm called George_LRU, :-),
> > where should I add the "keytype"? ( like GSDF, LRU, LFUDA, here I
> > want to add George_LRU).
> >
> > Best regards,
> > George, Ma
Received on Wed Apr 10 2002 - 11:09:04 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:07 MST