Loading...
Searching...
No Matches
XrdPfcConfiguration.cc
Go to the documentation of this file.
#include "XrdPfc.hh"
#include "XrdPfcTrace.hh"
#include "XrdPfcInfo.hh"
#include "XrdPfcResourceMonitor.hh"
#include "XrdPfcPurgePin.hh"
#include "XrdOss/XrdOss.hh"
#include "XrdOuc/XrdOucEnv.hh"
#include "XrdOuc/XrdOucUtils.hh"
#include "XrdOuc/XrdOucStream.hh"
#include "XrdOuc/XrdOucPinLoader.hh"
#include "XrdOuc/XrdOuca2x.hh"
#include "XrdVersion.hh"
#include "XrdOfs/XrdOfsConfigPI.hh"
#include "XrdSys/XrdSysXAttr.hh"
#include <fcntl.h>
extern XrdSysXAttr *XrdSysXAttrActive;
namespace XrdPfc
{
const char *trace_what_strings[] = {"","error ","warning ","info ","debug ","dump "};
}
using namespace XrdPfc;
XrdVERSIONINFO(XrdOucGetCache, XrdPfc);
Configuration::Configuration() :
m_hdfsmode(false),
m_allow_xrdpfc_command(false),
m_data_space("public"),
m_meta_space("public"),
m_diskTotalSpace(-1),
m_diskUsageLWM(-1),
m_diskUsageHWM(-1),
m_fileUsageBaseline(-1),
m_fileUsageNominal(-1),
m_fileUsageMax(-1),
m_purgeInterval(300),
m_purgeColdFilesAge(-1),
m_purgeAgeBasedPeriod(10),
m_accHistorySize(20),
m_dirStatsInterval(900),
m_dirStatsStoreDepth(1),
m_bufferSize(128*1024),
m_RamAbsAvailable(0),
m_RamKeepStdBlocks(0),
m_wqueue_blocks(16),
m_wqueue_threads(4),
m_prefetch_max_blocks(10),
m_hdfsbsize(128*1024*1024),
m_flushCnt(2000),
m_cs_UVKeep(-1),
m_cs_Chk(CSChk_Net),
m_cs_ChkTLS(false),
m_onlyIfCachedMinSize(1024*1024),
m_onlyIfCachedMinFrac(1.0)
{}
bool Cache::cfg2bytes(const std::string &str, long long &store, long long totalSpace, const char *name) const
{
char errStr[1024];
snprintf(errStr, 1024, "ConfigParameters() Error parsing parameter %s", name);
if (::isalpha(*(str.rbegin())))
{
if (XrdOuca2x::a2sz(m_log, errStr, str.c_str(), &store, 0, totalSpace))
{
return false;
}
}
else
{
char *eP;
errno = 0;
double frac = strtod(str.c_str(), &eP);
if (errno || eP == str.c_str())
{
m_log.Emsg(errStr, str.c_str());
return false;
}
store = static_cast<long long>(totalSpace * frac + 0.5);
}
if (store < 0 || store > totalSpace)
{
snprintf(errStr, 1024, "ConfigParameters() Error: parameter %s should be between 0 and total available disk space (%lld) - it is %lld (given as %s)",
name, totalSpace, store, str.c_str());
m_log.Emsg(errStr, "");
return false;
}
return true;
}
bool Cache::blocksize_str2value(const char *from, const char *str,
long long &val, long long min, long long max) const
{
if (XrdOuca2x::a2sz(m_log, "Error parsing block-size", str, &val, min, max))
return false;
if (val & 0xFFF) {
val &= ~0x0FFF;
val += 0x1000;
m_log.Emsg(from, "blocksize must be a multiple of 4 kB. Rounded up.");
}
return true;
}
bool Cache::prefetch_str2value(const char *from, const char *str,
int &val, int min, int max) const
{
if (XrdOuca2x::a2i(m_log, "Error parsing prefetch block count", str, &val, min, max))
return false;
return true;
}
/* Function: xcschk
Purpose: To parse the directive: cschk <parms>
parms: [[no]net] [[no]tls] [[no]cache] [uvkeep <arg>]
all Checksum check on cache & net transfers.
cache Checksum check on cache only, 'no' turns it off.
net Checksum check on net transfers 'no' turns it off.
tls use TLS if server doesn't support checksums 'no' turns it off.
uvkeep Maximum amount of time a cached file make be kept if it
contains unverified checksums as n[d|h|m|s], where 'n'
is a non-negative integer. A value of 0 prohibits disk
caching unless the checksum can be verified. You can
also specify "lru" which means the standard purge policy
is to be used.
Output: true upon success or false upon failure.
*/
bool Cache::xcschk(XrdOucStream &Config)
{
const char *val, *val2;
struct cschkopts {const char *opname; int opval;} csopts[] =
{
{"off", CSChk_None},
{"cache", CSChk_Cache},
{"net", CSChk_Net},
{"tls", CSChk_TLS}
};
int i, numopts = sizeof(csopts)/sizeof(struct cschkopts);
bool isNo;
if (! (val = Config.GetWord()))
{m_log.Emsg("Config", "cschk parameter not specified"); return false; }
while(val)
{
if ((isNo = strncmp(val, "no", 2) == 0))
val2 = val + 2;
else
val2 = val;
for (i = 0; i < numopts; i++)
{
if (!strcmp(val2, csopts[i].opname))
{
if (isNo)
m_configuration.m_cs_Chk &= ~csopts[i].opval;
else if (csopts[i].opval)
m_configuration.m_cs_Chk |= csopts[i].opval;
else
m_configuration.m_cs_Chk = csopts[i].opval;
break;
}
}
if (i >= numopts)
{
if (strcmp(val, "uvkeep"))
{
m_log.Emsg("Config", "invalid cschk option -", val);
return false;
}
if (!(val = Config.GetWord()))
{
m_log.Emsg("Config", "cschk uvkeep value not specified");
return false;
}
if (!strcmp(val, "lru"))
m_configuration.m_cs_UVKeep = -1;
else
{
int uvkeep;
if (XrdOuca2x::a2tm(m_log, "uvkeep time", val, &uvkeep, 0))
return false;
m_configuration.m_cs_UVKeep = uvkeep;
}
}
val = Config.GetWord();
}
// Decompose into separate TLS state, it is only passed on to psx
m_configuration.m_cs_ChkTLS = m_configuration.m_cs_Chk & CSChk_TLS;
m_configuration.m_cs_Chk &= ~CSChk_TLS;
m_env->Put("psx.CSNet", m_configuration.is_cschk_net() ? (m_configuration.m_cs_ChkTLS ? "2" : "1") : "0");
return true;
}
/* Function: xdlib
Purpose: To parse the directive: decisionlib <path> [<parms>]
<path> the path of the decision library to be used.
<parms> optional parameters to be passed.
Output: true upon success or false upon failure.
*/
bool Cache::xdlib(XrdOucStream &Config)
{
const char* val;
std::string libp;
if (! (val = Config.GetWord()) || ! val[0])
{
TRACE(Info," Cache::Config() decisionlib not specified; always caching files");
return true;
}
else
{
libp = val;
}
char params[4096];
if (val[0])
Config.GetRest(params, 4096);
else
params[0] = 0;
XrdOucPinLoader* myLib = new XrdOucPinLoader(&m_log, 0, "decisionlib",
libp.c_str());
Decision *(*ep)(XrdSysError&);
ep = (Decision *(*)(XrdSysError&))myLib->Resolve("XrdPfcGetDecision");
if (! ep) {myLib->Unload(true); return false; }
Decision * d = ep(m_log);
if (! d)
{
TRACE(Error, "Config() decisionlib was not able to create a decision object");
return false;
}
if (params[0])
d->ConfigDecision(params);
m_decisionpoints.push_back(d);
return true;
}
/* Function: xplib
Purpose: To parse the directive: purgelib <path> [<parms>]
<path> the path of the decision library to be used.
<parms> optional parameters to be passed.
Output: true upon success or false upon failure.
*/
bool Cache::xplib(XrdOucStream &Config)
{
const char* val;
std::string libp;
if (! (val = Config.GetWord()) || ! val[0])
{
TRACE(Info," Cache::Config() purgelib not specified; will use LRU for purging files");
return true;
}
else
{
libp = val;
}
char params[4096];
if (val[0])
Config.GetRest(params, 4096);
else
params[0] = 0;
XrdOucPinLoader* myLib = new XrdOucPinLoader(&m_log, 0, "purgelib",
libp.c_str());
PurgePin *(*ep)(XrdSysError&);
ep = (PurgePin *(*)(XrdSysError&))myLib->Resolve("XrdPfcGetPurgePin");
if (! ep) {myLib->Unload(true); return false; }
PurgePin * dp = ep(m_log);
if (! dp)
{
TRACE(Error, "Config() purgelib was not able to create a Purge Plugin object?");
return false;
}
m_purge_pin = dp;
if (params[0])
m_purge_pin->ConfigPurgePin(params);
return true;
}
/* Function: xtrace
Purpose: To parse the directive: trace <level>
Output: true upon success or false upon failure.
*/
bool Cache::xtrace(XrdOucStream &Config)
{
char *val;
static struct traceopts {const char *opname; int opval; } tropts[] =
{
{"none", 0},
{"error", 1},
{"warning", 2},
{"info", 3},
{"debug", 4},
{"dump", 5},
{"dumpxl", 6}
};
int numopts = sizeof(tropts)/sizeof(struct traceopts);
if (! (val = Config.GetWord()))
{m_log.Emsg("Config", "trace option not specified"); return 1; }
for (int i = 0; i < numopts; i++)
{
if (! strcmp(val, tropts[i].opname))
{
m_trace->What = tropts[i].opval;
return true;
}
}
m_log.Emsg("Config", "invalid trace option -", val);
return false;
}
// Determine if oss spaces are operational and if they support xattrs.
bool Cache::test_oss_basics_and_features()
{
static const char *epfx = "test_oss_basics_and_features()";
const auto &conf = m_configuration;
const char *user = conf.m_username.c_str();
XrdOucEnv env;
auto check_space = [&](const char *space, bool &has_xattr)
{
std::string fname("__prerun_test_pfc_");
fname += space;
fname += "_space__";
env.Put("oss.cgroup", space);
int res = m_oss->Create(user, fname.c_str(), 0600, env, XRDOSS_mkpath);
if (res != XrdOssOK) {
m_log.Emsg(epfx, "Can not create a file on space", space);
return false;
}
XrdOssDF *oss_file = m_oss->newFile(user);
res = oss_file->Open(fname.c_str(), O_RDWR, 0600, env);
if (res != XrdOssOK) {
m_log.Emsg(epfx, "Can not open a file on space", space);
return false;
}
res = oss_file->Write(fname.data(), 0, fname.length());
if (res != (int) fname.length()) {
m_log.Emsg(epfx, "Can not write into a file on space", space);
return false;
}
has_xattr = true;
long long fsize = fname.length();
res = XrdSysXAttrActive->Set("pfc.fsize", &fsize, sizeof(long long), 0, oss_file->getFD(), 0);
if (res != 0) {
m_log.Emsg(epfx, "Can not write xattr to a file on space", space);
has_xattr = false;
}
oss_file->Close();
if (has_xattr) {
char pfn[4096];
m_oss->Lfn2Pfn(fname.c_str(), pfn, 4096);
fsize = -1ll;
res = XrdSysXAttrActive->Get("pfc.fsize", &fsize, sizeof(long long), pfn);
if (res != sizeof(long long) || fsize != (long long) fname.length())
{
m_log.Emsg(epfx, "Can not read xattr from a file on space", space);
has_xattr = false;
}
}
res = m_oss->Unlink(fname.c_str());
if (res != XrdOssOK) {
m_log.Emsg(epfx, "Can not unlink a file on space", space);
return false;
}
return true;
};
bool aOK = true;
aOK &= check_space(conf.m_data_space.c_str(), m_dataXattr);
aOK &= check_space(conf.m_meta_space.c_str(), m_metaXattr);
return aOK;
}
//______________________________________________________________________________
/* Function: Config
Purpose: To parse configuration file and configure Cache instance.
Output: true upon success or false upon failure.
*/
bool Cache::Config(const char *config_filename, const char *parameters, XrdOucEnv *env)
{
// Indicate whether or not we are a client instance
const char *theINS = getenv("XRDINSTANCE");
m_isClient = (theINS != 0 && strncmp("*client ", theINS, 8) == 0);
// Tell everyone else we are a caching proxy
XrdOucEnv::Export("XRDPFC", 1);
XrdOucEnv emptyEnv;
XrdOucEnv *myEnv = env ? env : &emptyEnv;
XrdOucStream Config(&m_log, theINS, myEnv, "=====> ");
if (! config_filename || ! *config_filename)
{
TRACE(Error, "Config() configuration file not specified.");
return false;
}
int fd;
if ( (fd = open(config_filename, O_RDONLY, 0)) < 0)
{
TRACE( Error, "Config() can't open configuration file " << config_filename);
return false;
}
Config.Attach(fd);
static const char *cvec[] = { "*** pfc plugin config:", 0 };
Config.Capture(cvec);
// Obtain OFS configurator for OSS plugin.
XrdOfsConfigPI *ofsCfg = XrdOfsConfigPI::New(config_filename,&Config,&m_log,
&XrdVERSIONINFOVAR(XrdOucGetCache));
if (! ofsCfg) return false;
TmpConfiguration tmpc;
Configuration &CFG = m_configuration;
// Adjust default parameters for client/serverless caching
if (m_isClient)
{
m_configuration.m_bufferSize = 128 * 1024; // same as normal.
m_configuration.m_wqueue_blocks = 8;
m_configuration.m_wqueue_threads = 1;
}
// If network checksum processing is the default, indicate so.
if (m_configuration.is_cschk_net()) m_env->Put("psx.CSNet", m_configuration.m_cs_ChkTLS ? "2" : "1");
// Actual parsing of the config file.
bool retval = true, aOK = true;
char *var;
while ((var = Config.GetMyFirstWord()))
{
if (! strcmp(var,"pfc.osslib"))
{
retval = ofsCfg->Parse(XrdOfsConfigPI::theOssLib);
}
else if (! strcmp(var,"pfc.cschk"))
{
retval = xcschk(Config);
}
else if (! strcmp(var,"pfc.decisionlib"))
{
retval = xdlib(Config);
}
else if (! strcmp(var,"pfc.purgelib"))
{
retval = xplib(Config);
}
else if (! strcmp(var,"pfc.trace"))
{
retval = xtrace(Config);
}
else if (! strcmp(var,"pfc.allow_xrdpfc_command"))
{
m_configuration.m_allow_xrdpfc_command = true;
}
else if (! strncmp(var,"pfc.", 4))
{
retval = ConfigParameters(std::string(var+4), Config, tmpc);
}
if ( ! retval)
{
TRACE(Error, "Config() error in parsing");
aOK = false;
}
}
Config.Close();
// Load OSS plugin.
auto orig_runmode = myEnv->Get("oss.runmode");
myEnv->Put("oss.runmode", "pfc");
if (m_configuration.is_cschk_cache())
{
char csi_conf[128];
if (snprintf(csi_conf, 128, "space=%s nofill", m_configuration.m_meta_space.c_str()) < 128)
{
ofsCfg->Push(XrdOfsConfigPI::theOssLib, "libXrdOssCsi.so", csi_conf);
} else {
TRACE(Error, "Config() buffer too small for libXrdOssCsi params.");
return false;
}
}
if (ofsCfg->Load(XrdOfsConfigPI::theOssLib, myEnv))
{
ofsCfg->Plugin(m_oss);
}
else
{
TRACE(Error, "Config() Unable to create an OSS object");
return false;
}
if (orig_runmode) myEnv->Put("oss.runmode", orig_runmode);
else myEnv->Put("oss.runmode", "");
// Test if OSS is operational, determine optional features.
aOK &= test_oss_basics_and_features();
// sets default value for disk usage
XrdOssVSInfo sP;
{
if (m_configuration.m_meta_space != m_configuration.m_data_space &&
m_oss->StatVS(&sP, m_configuration.m_meta_space.c_str(), 1) < 0)
{
m_log.Emsg("ConfigParameters()", "error obtaining stat info for meta space ", m_configuration.m_meta_space.c_str());
return false;
}
if (m_configuration.m_meta_space != m_configuration.m_data_space && sP.Total < 10ll << 20)
{
m_log.Emsg("ConfigParameters()", "available data space is less than 10 MB (can be due to a mistake in oss.localroot directive) for space ",
m_configuration.m_meta_space.c_str());
return false;
}
if (m_oss->StatVS(&sP, m_configuration.m_data_space.c_str(), 1) < 0)
{
m_log.Emsg("ConfigParameters()", "error obtaining stat info for data space ", m_configuration.m_data_space.c_str());
return false;
}
if (sP.Total < 10ll << 20)
{
m_log.Emsg("ConfigParameters()", "available data space is less than 10 MB (can be due to a mistake in oss.localroot directive) for space ",
m_configuration.m_data_space.c_str());
return false;
}
m_configuration.m_diskTotalSpace = sP.Total;
if (cfg2bytes(tmpc.m_diskUsageLWM, m_configuration.m_diskUsageLWM, sP.Total, "lowWatermark") &&
cfg2bytes(tmpc.m_diskUsageHWM, m_configuration.m_diskUsageHWM, sP.Total, "highWatermark"))
{
if (m_configuration.m_diskUsageLWM >= m_configuration.m_diskUsageHWM) {
m_log.Emsg("ConfigParameters()", "pfc.diskusage should have lowWatermark < highWatermark.");
aOK = false;
}
}
else aOK = false;
if ( ! tmpc.m_fileUsageMax.empty())
{
if (cfg2bytes(tmpc.m_fileUsageBaseline, m_configuration.m_fileUsageBaseline, sP.Total, "files baseline") &&
cfg2bytes(tmpc.m_fileUsageNominal, m_configuration.m_fileUsageNominal, sP.Total, "files nominal") &&
cfg2bytes(tmpc.m_fileUsageMax, m_configuration.m_fileUsageMax, sP.Total, "files max"))
{
if (m_configuration.m_fileUsageBaseline >= m_configuration.m_fileUsageNominal ||
m_configuration.m_fileUsageBaseline >= m_configuration.m_fileUsageMax ||
m_configuration.m_fileUsageNominal >= m_configuration.m_fileUsageMax)
{
m_log.Emsg("ConfigParameters()", "pfc.diskusage files should have baseline < nominal < max.");
aOK = false;
}
if (aOK && m_configuration.m_fileUsageMax >= m_configuration.m_diskUsageLWM)
{
m_log.Emsg("ConfigParameters()", "pfc.diskusage files values must be below lowWatermark");
aOK = false;
}
}
else aOK = false;
}
}
// sets flush frequency
if ( ! tmpc.m_flushRaw.empty())
{
if (::isalpha(*(tmpc.m_flushRaw.rbegin())))
{
if (XrdOuca2x::a2sz(m_log, "Error getting number of bytes written before flush", tmpc.m_flushRaw.c_str(),
&m_configuration.m_flushCnt,
100 * m_configuration.m_bufferSize , 100000 * m_configuration.m_bufferSize))
{
return false;
}
m_configuration.m_flushCnt /= m_configuration.m_bufferSize;
}
else
{
if (XrdOuca2x::a2ll(m_log, "Error getting number of blocks written before flush", tmpc.m_flushRaw.c_str(),
&m_configuration.m_flushCnt, 100, 100000))
{
return false;
}
}
}
// get number of available RAM blocks after process configuration
if (m_configuration.m_RamAbsAvailable == 0)
{
m_configuration.m_RamAbsAvailable = m_isClient ? 256ll * 1024 * 1024 : 1024ll * 1024 * 1024;
char buff[1024];
snprintf(buff, sizeof(buff), "RAM usage pfc.ram is not specified. Default value %s is used.", m_isClient ? "256m" : "1g");
m_log.Say("Config info: ", buff);
}
// Setup number of standard-size blocks not released back to the system to 5% of total RAM.
m_configuration.m_RamKeepStdBlocks = (m_configuration.m_RamAbsAvailable / m_configuration.m_bufferSize + 1) * 5 / 100;
// Set tracing to debug if this is set in environment
char* cenv = getenv("XRDDEBUG");
if (cenv && ! strcmp(cenv,"1") && m_trace->What < 4) m_trace->What = 4;
if (aOK)
{
// 000 001 010
const char *csc[] = {"off", "cache nonet", "nocache net notls",
// 011
"cache net notls",
// 100 101 110
"off", "cache nonet", "nocache net tls",
// 111
"cache net tls"};
char uvk[32];
if (m_configuration.m_cs_UVKeep < 0)
strcpy(uvk, "lru");
else
sprintf(uvk, "%lld", (long long) m_configuration.m_cs_UVKeep);
float ram_gb = (m_configuration.m_RamAbsAvailable) / float(1024*1024*1024);
char urlcgi_blks[64] = "ignore", urlcgi_npref[32] = "ignore";
if (CFG.m_cgi_blocksize_allowed)
snprintf(urlcgi_blks, sizeof(urlcgi_blks), "%lldk %lldk",
CFG.m_cgi_min_bufferSize >> 10, CFG.m_cgi_max_bufferSize >> 10);
if (CFG.m_cgi_prefetch_allowed)
snprintf(urlcgi_npref, sizeof(urlcgi_npref), "%d %d",
CFG.m_cgi_min_prefetch_max_blocks, CFG.m_cgi_max_prefetch_max_blocks);
char buff[8192];
int loff = 0;
loff = snprintf(buff, sizeof(buff), "Config effective %s pfc configuration:\n"
" pfc.cschk %s uvkeep %s\n"
" pfc.blocksize %lldk\n"
" pfc.prefetch %d\n"
" pfc.urlcgi blocksize %s prefetch %s\n"
" pfc.ram %.fg\n"
" pfc.writequeue %d %d\n"
" # Total available disk: %lld\n"
" pfc.diskusage %lld %lld files %lld %lld %lld purgeinterval %d purgecoldfiles %d\n"
" pfc.spaces %s %s\n"
" pfc.trace %d\n"
" pfc.flush %lld\n"
" pfc.acchistorysize %d\n"
" pfc.onlyIfCachedMinBytes %lld\n"
" pfc.onlyIfCachedMinFrac %.2f\n",
config_filename,
csc[int(m_configuration.m_cs_Chk)], uvk,
m_configuration.m_bufferSize >> 10,
m_configuration.m_prefetch_max_blocks,
urlcgi_blks, urlcgi_npref,
ram_gb,
m_configuration.m_wqueue_blocks, m_configuration.m_wqueue_threads,
sP.Total,
m_configuration.m_diskUsageLWM, m_configuration.m_diskUsageHWM,
m_configuration.m_fileUsageBaseline, m_configuration.m_fileUsageNominal, m_configuration.m_fileUsageMax,
m_configuration.m_purgeInterval, m_configuration.m_purgeColdFilesAge,
m_configuration.m_data_space.c_str(),
m_configuration.m_meta_space.c_str(),
m_trace->What,
m_configuration.m_flushCnt,
m_configuration.m_accHistorySize,
m_configuration.m_onlyIfCachedMinSize,
m_configuration.m_onlyIfCachedMinFrac);
if (m_configuration.is_dir_stat_reporting_on())
{
loff += snprintf(buff + loff, sizeof(buff) - loff,
" pfc.dirstats interval %d maxdepth %d (internal: size_of_dirlist %d, size_of_globlist %d)\n",
m_configuration.m_dirStatsInterval, m_configuration.m_dirStatsStoreDepth,
(int) m_configuration.m_dirStatsDirs.size(), (int) m_configuration.m_dirStatsDirGlobs.size());
loff += snprintf(buff + loff, sizeof(buff) - loff, " dirlist:\n");
for (std::set<std::string>::iterator i = m_configuration.m_dirStatsDirs.begin(); i != m_configuration.m_dirStatsDirs.end(); ++i)
loff += snprintf(buff + loff, sizeof(buff) - loff, " %s\n", i->c_str());
loff += snprintf(buff + loff, sizeof(buff) - loff, " globlist:\n");
for (std::set<std::string>::iterator i = m_configuration.m_dirStatsDirGlobs.begin(); i != m_configuration.m_dirStatsDirGlobs.end(); ++i)
loff += snprintf(buff + loff, sizeof(buff) - loff, " %s/*\n", i->c_str());
}
if (m_configuration.m_hdfsmode)
{
loff += snprintf(buff + loff, sizeof(buff) - loff, " pfc.hdfsmode hdfsbsize %lld\n", m_configuration.m_hdfsbsize);
}
if (m_configuration.m_username.empty())
{
char unameBuff[256];
XrdOucUtils::UserName(getuid(), unameBuff, sizeof(unameBuff));
m_configuration.m_username = unameBuff;
}
else
{
loff += snprintf(buff + loff, sizeof(buff) - loff, " pfc.user %s\n", m_configuration.m_username.c_str());
}
m_log.Say(buff);
m_env->Put("XRDPFC.SEGSIZE", std::to_string(m_configuration.m_bufferSize).c_str());
}
// Derived settings
m_prefetch_enabled = CFG.m_prefetch_max_blocks > 0 || CFG.m_cgi_max_prefetch_max_blocks > 0;
Info::s_maxNumAccess = CFG.m_accHistorySize;
m_gstream = (XrdXrootdGStream*) m_env->GetPtr("pfc.gStream*");
m_log.Say(" pfc g-stream has", m_gstream ? "" : " NOT", " been configured via xrootd.monitor directive\n");
// Create the ResourceMonitor and get it ready for starting the main thread function.
if (aOK)
{
m_res_mon = new ResourceMonitor(*m_oss);
m_res_mon->init_before_main();
}
m_log.Say("=====> Proxy file cache configuration parsing ", aOK ? "completed" : "failed");
if (ofsCfg) delete ofsCfg;
// XXXX-CKSUM Testing. To be removed after OssPgi is also merged and valildated.
// Building of xrdpfc_print fails when this is enabled.
#ifdef XRDPFC_CKSUM_TEST
{
int xxx = m_configuration.m_cs_Chk;
for (m_configuration.m_cs_Chk = CSChk_None; m_configuration.m_cs_Chk <= CSChk_Both; ++m_configuration.m_cs_Chk)
{
Info::TestCksumStuff();
}
m_configuration.m_cs_Chk = xxx;
}
#endif
return aOK;
}
//------------------------------------------------------------------------------
bool Cache::ConfigParameters(std::string part, XrdOucStream& config, TmpConfiguration &tmpc)
{
struct ConfWordGetter
{
XrdOucStream &m_config;
char *m_last_word;
ConfWordGetter(XrdOucStream& c) : m_config(c), m_last_word((char*)1) {}
const char* GetWord() { if (HasLast()) m_last_word = m_config.GetWord(); return HasLast() ? m_last_word : ""; }
bool HasLast() { return (m_last_word != 0); }
};
ConfWordGetter cwg(config);
Configuration &CFG = m_configuration;
if ( part == "user" )
{
m_configuration.m_username = cwg.GetWord();
if ( ! cwg.HasLast())
{
m_log.Emsg("Config", "Error: pfc.user requires a parameter.");
return false;
}
}
else if ( part == "diskusage" )
{
tmpc.m_diskUsageLWM = cwg.GetWord();
tmpc.m_diskUsageHWM = cwg.GetWord();
if (tmpc.m_diskUsageHWM.empty())
{
m_log.Emsg("Config", "Error: pfc.diskusage parameter requires at least two arguments.");
return false;
}
const char *p = 0;
while ((p = cwg.GetWord()) && cwg.HasLast())
{
if (strcmp(p, "files") == 0)
{
tmpc.m_fileUsageBaseline = cwg.GetWord();
tmpc.m_fileUsageNominal = cwg.GetWord();
tmpc.m_fileUsageMax = cwg.GetWord();
if ( ! cwg.HasLast())
{
m_log.Emsg("Config", "Error: pfc.diskusage files directive requires three arguments.");
return false;
}
}
else if (strcmp(p, "sleep") == 0 || strcmp(p, "purgeinterval") == 0)
{
if (strcmp(p, "sleep") == 0) m_log.Emsg("Config", "warning sleep directive is deprecated in pfc.diskusage. Please use purgeinterval instead.");
if (XrdOuca2x::a2tm(m_log, "Error getting purgeinterval", cwg.GetWord(), &m_configuration.m_purgeInterval, 60, 3600))
{
return false;
}
}
else if (strcmp(p, "purgecoldfiles") == 0)
{
if (XrdOuca2x::a2tm(m_log, "Error getting purgecoldfiles age", cwg.GetWord(), &m_configuration.m_purgeColdFilesAge, 3600, 3600*24*360))
{
return false;
}
if (XrdOuca2x::a2i(m_log, "Error getting purgecoldfiles period", cwg.GetWord(), &m_configuration.m_purgeAgeBasedPeriod, 1, 1000))
{
return false;
}
}
else
{
m_log.Emsg("Config", "Error: diskusage stanza contains unknown directive", p);
}
}
}
else if ( part == "acchistorysize" )
{
if ( XrdOuca2x::a2i(m_log, "Error getting access-history-size", cwg.GetWord(), &m_configuration.m_accHistorySize, 20, 200))
{
return false;
}
}
else if ( part == "dirstats" )
{
const char *p = 0;
while ((p = cwg.GetWord()) && cwg.HasLast())
{
if (strcmp(p, "interval") == 0)
{
int validIntervals[] = {60, 120, 300, 600, 900, 1200, 1800, 3600};
int size = sizeof(validIntervals) / sizeof(int);
if (XrdOuca2x::a2tm(m_log, "Error getting dirstsat interval", cwg.GetWord(),
&m_configuration.m_dirStatsInterval, validIntervals[0], validIntervals[size - 1]))
{
return false;
}
bool match = false, round_down = false;
for (int i = 0; i < size; i++) {
if (validIntervals[i] == m_configuration.m_dirStatsInterval) {
match = true;
break;
}
if (i > 0 && m_configuration.m_dirStatsInterval < validIntervals[i]) {
m_configuration.m_dirStatsInterval = validIntervals[i - 1];
round_down = true;
break;
}
}
if ( ! match && ! round_down) {
m_log.Emsg("Config", "Error: dirstat interval parsing failed.");
return false;
}
if (round_down) {
m_log.Emsg("Config", "Info: dirstat interval was rounded down to the nearest valid value.");
}
}
else if (strcmp(p, "maxdepth") == 0)
{
if (XrdOuca2x::a2i(m_log, "Error getting maxdepth value", cwg.GetWord(),
&m_configuration.m_dirStatsStoreDepth, 0, 16))
{
return false;
}
}
else if (strcmp(p, "dir") == 0)
{
p = cwg.GetWord();
if (p && p[0] == '/')
{
// XXX -- should we just store them as sets of PathTokenizer objects, not strings?
char d[1024]; d[0] = 0;
int depth = 0;
{ // Compress multiple slashes and "measure" depth
const char *pp = p;
char *pd = d;
*(pd++) = *(pp++);
while (*pp != 0)
{
if (*(pd - 1) == '/')
{
if (*pp == '/')
{
++pp; continue;
}
++depth;
}
*(pd++) = *(pp++);
}
*(pd--) = 0;
// remove trailing but but not leading /
if (*pd == '/' && pd != d) *pd = 0;
}
int ld = strlen(d);
if (ld >= 2 && d[ld-1] == '*' && d[ld-2] == '/')
{
d[ld-2] = 0;
ld -= 2;
m_configuration.m_dirStatsDirGlobs.insert(d);
printf("Glob %s -> %s -- depth = %d\n", p, d, depth);
}
else
{
m_configuration.m_dirStatsDirs.insert(d);
printf("Dir %s -> %s -- depth = %d\n", p, d, depth);
}
m_configuration.m_dirStatsStoreDepth = std::max(m_configuration.m_dirStatsStoreDepth, depth);
}
else
{
m_log.Emsg("Config", "Error: dirstats dir parameter requires a directory argument starting with a '/'.");
return false;
}
}
else
{
m_log.Emsg("Config", "Error: dirstats stanza contains unknown directive '", p, "'");
return false;
}
}
}
else if ( part == "blocksize" )
{
if ( ! blocksize_str2value("Config", cwg.GetWord(), CFG.m_bufferSize,
CFG.s_min_bufferSize, CFG.s_max_bufferSize))
return false;
}
else if ( part == "prefetch" || part == "nramprefetch" )
{
if (part == "nramprefetch")
{
m_log.Emsg("Config", "pfc.nramprefetch is deprecated, please use pfc.prefetch instead. Replacing the directive internally.");
}
if ( ! prefetch_str2value("Config", cwg.GetWord(), CFG.m_prefetch_max_blocks,
0, CFG.s_max_prefetch_max_blocks))
return false;
}
else if ( part == "urlcgi" )
{
// pfc.urlcgi [blocksize {ignore | min max}] [prefetch {ignore | min max}]
const char *p = 0;
while ((p = cwg.GetWord()) && cwg.HasLast())
{
if (strcmp(p, "blocksize") == 0)
{
std::string bmin = cwg.GetWord();
if (bmin == "ignore")
continue;
std::string bmax = cwg.GetWord();
if ( ! cwg.HasLast()) {
m_log.Emsg("Config", "Error: pfc.urlcgi blocksize parameter requires two arguments.");
return false;
}
if ( ! blocksize_str2value("Config::urlcgi", bmin.c_str(), CFG.m_cgi_min_bufferSize,
CFG.s_min_bufferSize, CFG.s_max_bufferSize))
return false;
if ( ! blocksize_str2value("Config::urlcgi", bmax.c_str(), CFG.m_cgi_max_bufferSize,
CFG.s_min_bufferSize, CFG.s_max_bufferSize))
return false;
if (CFG.m_cgi_min_bufferSize > CFG.m_cgi_max_bufferSize) {
m_log.Emsg("Config", "Error: pfc.urlcgi blocksize second argument must be larger or equal to the first one.");
return false;
}
CFG.m_cgi_blocksize_allowed = true;
}
else if (strcmp(p, "prefetch") == 0)
{
std::string bmin = cwg.GetWord();
if (bmin == "ignore")
continue;
std::string bmax = cwg.GetWord();
if ( ! cwg.HasLast()) {
m_log.Emsg("Config", "Error: pfc.urlcgi blocksize parameter requires two arguments.");
return false;
}
if ( ! prefetch_str2value("Config::urlcgi", bmin.c_str(), CFG.m_cgi_min_prefetch_max_blocks,
0, CFG.s_max_prefetch_max_blocks))
return false;
if ( ! prefetch_str2value("Config::urlcgi", bmax.c_str(), CFG.m_cgi_max_prefetch_max_blocks,
0, CFG.s_max_prefetch_max_blocks))
return false;
if (CFG.m_cgi_min_prefetch_max_blocks > CFG.m_cgi_max_prefetch_max_blocks) {
m_log.Emsg("Config", "Error: pfc.urlcgi prefetch second argument must be larger or equal to the first one.");
return false;
}
CFG.m_cgi_prefetch_allowed = true;
}
else
{
m_log.Emsg("Config", "Error: urlcgi stanza contains unknown directive '", p, "'");
return false;
}
} // while get next pfc.urlcgi word
}
else if ( part == "nramread" )
{
m_log.Emsg("Config", "pfc.nramread is deprecated, please use pfc.ram instead. Ignoring this directive.");
cwg.GetWord(); // Ignoring argument.
}
else if ( part == "ram" )
{
long long minRAM = m_isClient ? 256 * 1024 * 1024 : 1024 * 1024 * 1024;
long long maxRAM = 256 * minRAM;
if ( XrdOuca2x::a2sz(m_log, "get RAM available", cwg.GetWord(), &m_configuration.m_RamAbsAvailable, minRAM, maxRAM))
{
return false;
}
}
else if ( part == "writequeue")
{
if (XrdOuca2x::a2i(m_log, "Error getting pfc.writequeue num-blocks", cwg.GetWord(), &m_configuration.m_wqueue_blocks, 1, 1024))
{
return false;
}
if (XrdOuca2x::a2i(m_log, "Error getting pfc.writequeue num-threads", cwg.GetWord(), &m_configuration.m_wqueue_threads, 1, 64))
{
return false;
}
}
else if ( part == "spaces" )
{
m_configuration.m_data_space = cwg.GetWord();
m_configuration.m_meta_space = cwg.GetWord();
if ( ! cwg.HasLast())
{
m_log.Emsg("Config", "spacenames requires two parameters: <data-space> <metadata-space>.");
return false;
}
}
else if ( part == "hdfsmode" )
{
m_log.Emsg("Config", "pfc.hdfsmode is currently unsupported.");
return false;
m_configuration.m_hdfsmode = true;
const char* params = cwg.GetWord();
if (params)
{
if (! strncmp("hdfsbsize", params, 9))
{
long long minBlSize = 32 * 1024;
long long maxBlSize = 128 * 1024 * 1024;
if ( XrdOuca2x::a2sz(m_log, "Error getting file fragment size", cwg.GetWord(), &m_configuration.m_hdfsbsize, minBlSize, maxBlSize))
{
return false;
}
}
else
{
m_log.Emsg("Config", "Error setting the fragment size parameter name");
return false;
}
}
}
else if ( part == "flush" )
{
tmpc.m_flushRaw = cwg.GetWord();
if ( ! cwg.HasLast())
{
m_log.Emsg("Config", "Error: pfc.flush requires a parameter.");
return false;
}
}
else if ( part == "onlyifcached" )
{
const char *p = 0;
while ((p = cwg.GetWord()) && cwg.HasLast())
{
if (strcmp(p, "minsize") == 0)
{
std::string minBytes = cwg.GetWord();
long long minBytesTop = 1024 * 1024 * 1024;
if (::isalpha(*(minBytes.rbegin())))
{
if (XrdOuca2x::a2sz(m_log, "Error in parsing minsize value for onlyifcached parameter", minBytes.c_str(), &m_configuration.m_onlyIfCachedMinSize, 0, minBytesTop))
{
return false;
}
}
else
{
if (XrdOuca2x::a2ll(m_log, "Error in parsing numeric minsize value for onlyifcached parameter", minBytes.c_str(),&m_configuration.m_onlyIfCachedMinSize, 0, minBytesTop))
{
return false;
}
}
}
if (strcmp(p, "minfrac") == 0)
{
std::string minFrac = cwg.GetWord();
char *eP;
errno = 0;
double frac = strtod(minFrac.c_str(), &eP);
if (errno || eP == minFrac.c_str())
{
m_log.Emsg("Config", "Error setting fraction for only-if-cached directive");
return false;
}
m_configuration.m_onlyIfCachedMinFrac = frac;
}
else
{
m_log.Emsg("Config", "Error: onlyifcached stanza contains unknown directive", p);
}
}
}
else
{
m_log.Emsg("ConfigParameters() unmatched pfc parameter", part.c_str());
return false;
}
return true;
}
XrdOfsConfigPI.hh
XrdOss.hh
XrdOssOK
#define XrdOssOK
Definition XrdOss.hh:50
XRDOSS_mkpath
#define XRDOSS_mkpath
Definition XrdOss.hh:466
XrdOucEnv.hh
XrdOucPinLoader.hh
XrdOucStream.hh
XrdOucUtils.hh
XrdOuca2x.hh
XrdVERSIONINFO
XrdVERSIONINFO(XrdOucGetCache, XrdPfc)
XrdPfcInfo.hh
XrdPfcPurgePin.hh
XrdPfcResourceMonitor.hh
XrdPfcTrace.hh
XrdSysXAttrActive
XrdSysXAttr * XrdSysXAttrActive
Definition XrdSysFAttr.cc:61
XrdOucGetCache
XrdOucCache * XrdOucGetCache(XrdSysLogger *logger, const char *config_filename, const char *parameters, XrdOucEnv *env)
Definition XrdPfc.cc:76
XrdPfc.hh
open
#define open
Definition XrdPosix.hh:76
isNo
int isNo(int dflt, const char *Msg1, const char *Msg2, const char *Msg3)
Definition XrdSecsssAdmin.cc:234
XrdSysXAttr.hh
Error
@ Error
Definition XrdTlsNotaryUtils.hh:42
TRACE
#define TRACE(act, x)
Definition XrdTrace.hh:63
XrdOfsConfigPI
Definition XrdOfsConfigPI.hh:61
XrdOfsConfigPI::Parse
bool Parse(TheLib what)
Definition XrdOfsConfigPI.cc:490
XrdOfsConfigPI::Plugin
bool Plugin(XrdAccAuthorize *&piP)
Get Authorization plugin.
Definition XrdOfsConfigPI.cc:694
XrdOfsConfigPI::New
static XrdOfsConfigPI * New(const char *cfn, XrdOucStream *cfgP, XrdSysError *errP, XrdVersionInfo *verP=0, XrdSfsFileSystem *sfsP=0)
Definition XrdOfsConfigPI.cc:466
XrdOfsConfigPI::Load
bool Load(int what, XrdOucEnv *envP=0)
Definition XrdOfsConfigPI.cc:382
XrdOfsConfigPI::Push
bool Push(TheLib what, const char *plugP, const char *parmP=0)
Definition XrdOfsConfigPI.cc:722
XrdOfsConfigPI::theOssLib
@ theOssLib
Oss plugin.
Definition XrdOfsConfigPI.hh:74
XrdOssDF::Close
virtual int Close(long long *retsz=0)=0
XrdOssDF::getFD
virtual int getFD()
Definition XrdOss.hh:426
XrdOssDF::Open
virtual int Open(const char *path, int Oflag, mode_t Mode, XrdOucEnv &env)
Definition XrdOss.hh:200
XrdOssDF::Write
virtual ssize_t Write(const void *buffer, off_t offset, size_t size)
Definition XrdOss.hh:345
XrdOssVSInfo
Definition XrdOssVS.hh:88
XrdOssVSInfo::Total
long long Total
Definition XrdOssVS.hh:90
XrdOucEnv
Definition XrdOucEnv.hh:42
XrdOucEnv::Get
char * Get(const char *varname)
Definition XrdOucEnv.hh:69
XrdOucEnv::Export
static int Export(const char *Var, const char *Val)
Definition XrdOucEnv.cc:170
XrdOucEnv::Put
void Put(const char *varname, const char *value)
Definition XrdOucEnv.hh:85
XrdOucPinLoader::Resolve
void * Resolve(const char *symbl, int mcnt=1)
Definition XrdOucPinLoader.cc:267
XrdOucPinLoader::Unload
void Unload(bool dodel=false)
Definition XrdOucPinLoader.cc:305
XrdOucStream
Definition XrdOucStream.hh:47
XrdOucStream::GetWord
char * GetWord(int lowcase=0)
Definition XrdOucStream.cc:745
XrdOucUtils::UserName
static int UserName(uid_t uID, char *uName, int uNsz)
Definition XrdOucUtils.cc:1396
XrdOuca2x::a2i
static int a2i(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition XrdOuca2x.cc:45
XrdOuca2x::a2sz
static int a2sz(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1)
Definition XrdOuca2x.cc:257
XrdOuca2x::a2ll
static int a2ll(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1)
Definition XrdOuca2x.cc:70
XrdOuca2x::a2tm
static int a2tm(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition XrdOuca2x.cc:288
XrdPfc::Cache::blocksize_str2value
bool blocksize_str2value(const char *from, const char *str, long long &val, long long min, long long max) const
Definition XrdPfcConfiguration.cc:103
XrdPfc::Cache::Config
bool Config(const char *config_filename, const char *parameters, XrdOucEnv *env)
Parse configuration file.
Definition XrdPfcConfiguration.cc:431
XrdPfc::Cache::prefetch_str2value
bool prefetch_str2value(const char *from, const char *str, int &val, int min, int max) const
Definition XrdPfcConfiguration.cc:118
XrdPfc::Decision::ConfigDecision
virtual bool ConfigDecision(const char *params)
Definition XrdPfcDecision.hh:56
XrdPfc::Info::s_maxNumAccess
static size_t s_maxNumAccess
Definition XrdPfcInfo.hh:311
XrdPfc::PurgePin::ConfigPurgePin
virtual bool ConfigPurgePin(const char *params)
Definition XrdPfcPurgePin.hh:64
XrdPfc::ResourceMonitor
Definition XrdPfcResourceMonitor.hh:38
XrdSysXAttr
Definition XrdSysXAttr.hh:43
XrdSysXAttr::Get
virtual int Get(const char *Aname, void *Aval, int Avsz, const char *Path, int fd=-1)=0
XrdSysXAttr::Set
virtual int Set(const char *Aname, const void *Aval, int Avsz, const char *Path, int fd=-1, int isNew=0)=0
XrdXrootdGStream
Definition XrdXrootdGStream.hh:44
XrdPfc
Definition XrdPfc.hh:41
XrdPfc::trace_what_strings
const char * trace_what_strings[]
Definition XrdPfcConfiguration.cc:26
XrdPfc::CSChk_Both
@ CSChk_Both
Definition XrdPfcTypes.hh:27
XrdPfc::CSChk_Net
@ CSChk_Net
Definition XrdPfcTypes.hh:27
XrdPfc::CSChk_TLS
@ CSChk_TLS
Definition XrdPfcTypes.hh:28
XrdPfc::CSChk_Cache
@ CSChk_Cache
Definition XrdPfcTypes.hh:27
XrdPfc::CSChk_None
@ CSChk_None
Definition XrdPfcTypes.hh:27
XrdPfc::Configuration
Contains parameters configurable from the xrootd config file.
Definition XrdPfc.hh:64
XrdPfc::Configuration::m_hdfsbsize
long long m_hdfsbsize
used with m_hdfsmode, default 128MB
Definition XrdPfc.hh:121
XrdPfc::Configuration::m_RamAbsAvailable
long long m_RamAbsAvailable
available from configuration
Definition XrdPfc.hh:108
XrdPfc::Configuration::m_flushCnt
long long m_flushCnt
nuber of unsynced blcoks on disk before flush is called
Definition XrdPfc.hh:122
XrdPfc::Configuration::m_cgi_max_bufferSize
long long m_cgi_max_bufferSize
max buffer size allowed in pfc.blocksize
Definition XrdPfc.hh:115
XrdPfc::Configuration::m_accHistorySize
int m_accHistorySize
max number of entries in access history part of cinfo file
Definition XrdPfc.hh:100
XrdPfc::Configuration::m_cgi_min_prefetch_max_blocks
int m_cgi_min_prefetch_max_blocks
min prefetch block count allowed in pfc.prefetch
Definition XrdPfc.hh:116
XrdPfc::Configuration::m_cgi_prefetch_allowed
bool m_cgi_prefetch_allowed
allow cgi setting of prefetch
Definition XrdPfc.hh:119
XrdPfc::Configuration::m_wqueue_threads
int m_wqueue_threads
number of threads writing blocks to disk
Definition XrdPfc.hh:111
XrdPfc::Configuration::m_diskTotalSpace
long long m_diskTotalSpace
total disk space on configured partition or oss space
Definition XrdPfc.hh:91
XrdPfc::Configuration::m_fileUsageMax
long long m_fileUsageMax
cache purge - files usage maximum
Definition XrdPfc.hh:96
XrdPfc::Configuration::m_fileUsageBaseline
long long m_fileUsageBaseline
cache purge - files usage baseline
Definition XrdPfc.hh:94
XrdPfc::Configuration::m_dirStatsStoreDepth
int m_dirStatsStoreDepth
maximum depth for statistics write out
Definition XrdPfc.hh:105
XrdPfc::Configuration::m_allow_xrdpfc_command
bool m_allow_xrdpfc_command
flag for enabling access to /xrdpfc-command/ functionality.
Definition XrdPfc.hh:85
XrdPfc::Configuration::m_diskUsageHWM
long long m_diskUsageHWM
cache purge - disk usage high water mark
Definition XrdPfc.hh:93
XrdPfc::Configuration::s_min_bufferSize
static constexpr long long s_min_bufferSize
Definition XrdPfc.hh:131
XrdPfc::Configuration::s_max_bufferSize
static constexpr long long s_max_bufferSize
Definition XrdPfc.hh:132
XrdPfc::Configuration::m_prefetch_max_blocks
int m_prefetch_max_blocks
default maximum number of blocks to prefetch per file
Definition XrdPfc.hh:112
XrdPfc::Configuration::m_cs_ChkTLS
bool m_cs_ChkTLS
Allow TLS.
Definition XrdPfc.hh:126
XrdPfc::Configuration::Configuration
Configuration()
Definition XrdPfcConfiguration.cc:33
XrdPfc::Configuration::m_fileUsageNominal
long long m_fileUsageNominal
cache purge - files usage nominal
Definition XrdPfc.hh:95
XrdPfc::Configuration::m_cs_Chk
int m_cs_Chk
Checksum check.
Definition XrdPfc.hh:125
XrdPfc::Configuration::m_purgeAgeBasedPeriod
int m_purgeAgeBasedPeriod
peform cold file / uvkeep purge every this many purge cycles
Definition XrdPfc.hh:99
XrdPfc::Configuration::m_hdfsmode
bool m_hdfsmode
flag for enabling block-level operation
Definition XrdPfc.hh:84
XrdPfc::Configuration::m_purgeColdFilesAge
int m_purgeColdFilesAge
purge files older than this age
Definition XrdPfc.hh:98
XrdPfc::Configuration::m_data_space
std::string m_data_space
oss space for data files
Definition XrdPfc.hh:88
XrdPfc::Configuration::m_diskUsageLWM
long long m_diskUsageLWM
cache purge - disk usage low water mark
Definition XrdPfc.hh:92
XrdPfc::Configuration::m_RamKeepStdBlocks
int m_RamKeepStdBlocks
number of standard-sized blocks kept after release
Definition XrdPfc.hh:109
XrdPfc::Configuration::m_bufferSize
long long m_bufferSize
cache block size, default 128 kB
Definition XrdPfc.hh:107
XrdPfc::Configuration::m_cgi_min_bufferSize
long long m_cgi_min_bufferSize
min buffer size allowed in pfc.blocksize
Definition XrdPfc.hh:114
XrdPfc::Configuration::m_dirStatsInterval
int m_dirStatsInterval
time between resource monitor statistics dump in seconds
Definition XrdPfc.hh:104
XrdPfc::Configuration::m_meta_space
std::string m_meta_space
oss space for metadata files (cinfo)
Definition XrdPfc.hh:89
XrdPfc::Configuration::m_wqueue_blocks
int m_wqueue_blocks
maximum number of blocks written per write-queue loop
Definition XrdPfc.hh:110
XrdPfc::Configuration::m_cgi_max_prefetch_max_blocks
int m_cgi_max_prefetch_max_blocks
max prefetch block count allowed in pfc.prefetch
Definition XrdPfc.hh:117
XrdPfc::Configuration::s_max_prefetch_max_blocks
static constexpr int s_max_prefetch_max_blocks
Definition XrdPfc.hh:134
XrdPfc::Configuration::m_cgi_blocksize_allowed
bool m_cgi_blocksize_allowed
allow cgi setting of blocksize
Definition XrdPfc.hh:118
XrdPfc::Configuration::m_onlyIfCachedMinFrac
double m_onlyIfCachedMinFrac
minimum fraction of downloaded file, used by only-if-cached CGI option
Definition XrdPfc.hh:129
XrdPfc::Configuration::m_cs_UVKeep
time_t m_cs_UVKeep
unverified checksum cache keep
Definition XrdPfc.hh:124
XrdPfc::Configuration::m_purgeInterval
int m_purgeInterval
sleep interval between cache purges
Definition XrdPfc.hh:97
XrdPfc::Configuration::m_onlyIfCachedMinSize
long long m_onlyIfCachedMinSize
minumum size of downloaded file, used by only-if-cached CGI option
Definition XrdPfc.hh:128
XrdPfc::TmpConfiguration
Definition XrdPfc.hh:140
XrdPfc::TmpConfiguration::m_diskUsageLWM
std::string m_diskUsageLWM
Definition XrdPfc.hh:141
XrdPfc::TmpConfiguration::m_diskUsageHWM
std::string m_diskUsageHWM
Definition XrdPfc.hh:142
XrdPfc::TmpConfiguration::m_fileUsageBaseline
std::string m_fileUsageBaseline
Definition XrdPfc.hh:143
XrdPfc::TmpConfiguration::m_fileUsageNominal
std::string m_fileUsageNominal
Definition XrdPfc.hh:144
XrdPfc::TmpConfiguration::m_flushRaw
std::string m_flushRaw
Definition XrdPfc.hh:146
XrdPfc::TmpConfiguration::m_fileUsageMax
std::string m_fileUsageMax
Definition XrdPfc.hh:145