00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <Basics.H>
00023 #include "ReadConfig.H"
00024 #include "CacheConfig.H"
00025
00026
00027 const char *Config_CacheSection = "CacheServer";
00028
00029
00030 const Text Config_Host(
00031 ReadConfig::TextVal(Config_CacheSection, "Host"));
00032 const Text Config_Port(
00033 ReadConfig::TextVal(Config_CacheSection, "Port"));
00034 static const Text Private_Dot(".");
00035 static const Text Private_MDRoot(
00036 ReadConfig::TextVal(Config_CacheSection, "MetaDataRoot"));
00037 const Text Config_MDRoot(
00038 Private_MDRoot.Empty() ? Private_Dot : Private_MDRoot);
00039 const Text Config_MDDir(
00040 ReadConfig::TextVal(Config_CacheSection, "MetaDataDir"));
00041 const Text Config_SVarsDir(
00042 ReadConfig::TextVal(Config_CacheSection, "StableVarsDir"));
00043 const Text Config_Deleting(
00044 ReadConfig::TextVal(Config_CacheSection, "Deleting"));
00045 const Text Config_HitFilter(
00046 ReadConfig::TextVal(Config_CacheSection, "HitFilter"));
00047 const Text Config_MPKsToWeed(
00048 ReadConfig::TextVal(Config_CacheSection, "MPKsToWeed"));
00049 const Text Config_SCacheDir(
00050 ReadConfig::TextVal(Config_CacheSection, "SCacheDir"));
00051 const Text Config_WeededLogDir(
00052 ReadConfig::TextVal(Config_CacheSection, "WeededLogDir"));
00053 const Text Config_CacheLogDir(
00054 ReadConfig::TextVal(Config_CacheSection, "CacheLogDir"));
00055 const Text Config_EmptyPKLogDir(
00056 ReadConfig::TextVal(Config_CacheSection, "EmptyPKLogDir"));
00057 const Text Config_GraphLogDir(
00058 ReadConfig::TextVal(Config_CacheSection, "GraphLogDir"));
00059 const Text Config_CILogDir(
00060 ReadConfig::TextVal(Config_CacheSection, "CILogDir"));
00061 const int Config_LeaseTimeoutHrs =
00062 ReadConfig::IntVal(Config_CacheSection, "LeaseTimeoutHrs");
00063
00064
00065 int Config_LeaseTimeoutSpeedup(1);
00066
00067
00068 const Text Config_CacheMDPath(Config_MDRoot +'/'+ Config_MDDir);
00069 const Text Config_SVarsPath(Config_CacheMDPath +'/'+ Config_SVarsDir);
00070 const Text Config_DeletingFile(Config_SVarsPath +'/'+ Config_Deleting);
00071 const Text Config_HitFilterFile(Config_SVarsPath +'/'+ Config_HitFilter);
00072 const Text Config_MPKsToWeedFile(Config_SVarsPath +'/'+ Config_MPKsToWeed);
00073 const Text Config_SCachePath(Config_CacheMDPath +'/'+ Config_SCacheDir);
00074 const Text Config_WeededLogPath(Config_CacheMDPath +'/'+ Config_WeededLogDir);
00075 const Text Config_CacheLogPath(Config_CacheMDPath +'/'+ Config_CacheLogDir);
00076 const Text Config_EmptyPKLogPath(Config_CacheMDPath +'/'+Config_EmptyPKLogDir);
00077 const Text Config_GraphLogPath(Config_CacheMDPath +'/'+ Config_GraphLogDir);
00078 const Text Config_CILogPath(Config_CacheMDPath +'/'+ Config_CILogDir);
00079 int Config_LeaseTimeoutSecs;
00080
00081 class CacheConfigInit {
00082 public:
00083 CacheConfigInit() throw ();
00084
00085 };
00086 static CacheConfigInit cacheConfigInit;
00087
00088 CacheConfigInit::CacheConfigInit() throw ()
00089 {
00090 (void) ReadConfig::OptIntVal(Config_CacheSection,
00091 "LeaseTimeoutSpeedup", Config_LeaseTimeoutSpeedup);
00092 const int SecsPerHour = 3600;
00093 Config_LeaseTimeoutSecs = max(1,
00094 (Config_LeaseTimeoutHrs * SecsPerHour) / Config_LeaseTimeoutSpeedup);
00095 }
00096