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

From: <maer727@dont-contact.us>
Date: Thu, 11 Apr 2002 10:56:38 +0800 (CST)

Thanks, Henrik pal!

I think I can directly use "George_LRU" in squid.conf to ask Squid to
use the policy all the time. ( After writing my own function and adding
it to the if-else cases of createRemovalPolicy_heap ) Do you mean I should use
"heap George_LRU" instead of "George_LRU"? Maybe I miss understand your meaning. :-)

Can I?

Best regards,
George, Ma
//////////////////////////
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 - 20:56:47 MDT

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