Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CacheConfigServer.C

Go to the documentation of this file.
00001 // Copyright (C) 2001, Compaq Computer Corporation
00002 // 
00003 // This file is part of Vesta.
00004 // 
00005 // Vesta is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 // 
00010 // Vesta is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with Vesta; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // Created on Tue Sep 16 10:37:52 PDT 1997 by heydon
00020 // Last modified on Thu Jan  2 18:43:10 EST 2003 by ken@xorian.net
00021 //      modified on Tue Feb  1 14:22:44 PST 2000 by heydon
00022 
00023 #include <Basics.H>
00024 #include <ReadConfig.H>
00025 #include <CacheConfig.H>
00026 #include "CacheConfigServer.H"
00027 
00028 // required values
00029 const int  Config_FreePauseDur =
00030   ReadConfig::IntVal(Config_CacheSection, "FreePauseDur");
00031 
00032 // optional values
00033 int Config_MaxRunning(1000);
00034 int Config_MaxBlocked(1000);
00035 int Config_WeedPauseDur(0);
00036 int Config_MaxCacheLogCnt(500);
00037 int Config_MPKFileFlushNum(20);
00038 int Config_FlushWorkerCnt(5);
00039 int Config_FlushNewPeriodCnt(1);
00040 int Config_PurgeWarmPeriodCnt(2);
00041 int Config_EvictPeriodCnt(3);
00042 bool Config_FreeAggressively(false);
00043 bool Config_ReadImmutable(true);
00044 bool Config_KeepNewOnFlush(false);
00045 bool Config_KeepOldOnFlush(false);
00046 
00047 class CacheConfigServerInit {
00048   public:
00049     CacheConfigServerInit() throw ();
00050     // initialize the "CacheConfigServer" module
00051 };
00052 static CacheConfigServerInit cacheConfigServerInit;
00053 
00054 CacheConfigServerInit::CacheConfigServerInit() throw ()
00055 {
00056     // initialize optional values
00057     (void) ReadConfig::OptIntVal(Config_CacheSection,
00058       "MaxRunning", /*OUT*/ Config_MaxRunning);
00059     (void) ReadConfig::OptIntVal(Config_CacheSection,
00060       "MaxBlocked", /*OUT*/ Config_MaxBlocked);
00061     (void) ReadConfig::OptIntVal(Config_CacheSection,
00062       "WeedPauseDur", /*OUT*/ Config_WeedPauseDur);
00063     (void) ReadConfig::OptIntVal(Config_CacheSection,
00064       "MaxCacheLogCnt", /*OUT*/ Config_MaxCacheLogCnt);
00065     (void) ReadConfig::OptIntVal(Config_CacheSection,
00066       "MPKFileFlushNum", /*OUT*/ Config_MPKFileFlushNum);
00067     (void) ReadConfig::OptIntVal(Config_CacheSection,
00068       "FlushWorkerCnt", /*OUT*/ Config_FlushWorkerCnt);
00069 
00070     if(!ReadConfig::OptIntVal(Config_CacheSection, "FlushNewPeriodCnt",
00071                               /*OUT*/ Config_FlushNewPeriodCnt))
00072       {
00073         // Use the old name (FreePeriodCnt) if FlushNewPeriodCnt isn't
00074         // set.
00075         (void) ReadConfig::OptIntVal(Config_CacheSection, "FreePeriodCnt",
00076                                      /*OUT*/ Config_FlushNewPeriodCnt);
00077       }
00078 
00079     if(!ReadConfig::OptIntVal(Config_CacheSection, "PurgeWarmPeriodCnt",
00080                               /*OUT*/ Config_PurgeWarmPeriodCnt))
00081       {
00082         // Default PurgeWarmPeriodCnt to FlushNewPeriodCnt+1
00083         Config_PurgeWarmPeriodCnt = Config_FlushNewPeriodCnt + 1;
00084       }
00085 
00086     if(!ReadConfig::OptIntVal(Config_CacheSection, "EvictPeriodCnt",
00087                               /*OUT*/ Config_EvictPeriodCnt))
00088       {
00089         // Default EvictPeriodCnt to PurgeWarmPeriodCnt+1
00090         Config_EvictPeriodCnt = Config_PurgeWarmPeriodCnt + 1;
00091       }
00092 
00093     (void) ReadConfig::OptBoolVal(Config_CacheSection,
00094       "FreeAggressively", /*OUT*/ Config_FreeAggressively);
00095     (void) ReadConfig::OptBoolVal(Config_CacheSection,
00096       "ReadImmutable", /*OUT*/ Config_ReadImmutable);
00097     (void) ReadConfig::OptBoolVal(Config_CacheSection,
00098       "KeepNewOnFlush", /*OUT*/ Config_KeepNewOnFlush);
00099     (void) ReadConfig::OptBoolVal(Config_CacheSection,
00100       "KeepOldOnFlush", /*OUT*/ Config_KeepOldOnFlush);
00101 }

Generated on Mon May 8 00:48:33 2006 for Vesta by  doxygen 1.4.2