Skip to content

Commit

Permalink
Add prefetch option in configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja authored and abh3 committed Jun 30, 2016
1 parent 8f7ca00 commit 3f25cc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/XrdFileCache/XrdFileCacheFactory.cc
Expand Up @@ -272,9 +272,11 @@ bool Factory::Config(XrdSysLogger *logger, const char *config_filename, const ch
loff = snprintf(buff, sizeof(buff), "result\n"
"\tpfc.cachedir %s\n"
"\tpfc.blocksize %lld\n"
"\tpfc.prefetch %d\n"
"\tpfc.nram %d\n\n",
m_configuration.m_cache_dir.c_str() ,
m_configuration.m_bufferSize,
m_configuration.m_bufferSize,
m_configuration.m_prefetch, // AMT not sure what parsing should be
m_configuration.m_NRamBuffers );

if (m_configuration.m_hdfsmode)
Expand All @@ -284,7 +286,6 @@ bool Factory::Config(XrdSysLogger *logger, const char *config_filename, const ch
loff += snprintf(&buff[loff], strlen(buff2), "%s", buff2);
}


char unameBuff[256];
if (m_configuration.m_username.empty()) {
XrdOucUtils::UserName(getuid(), unameBuff, sizeof(unameBuff));
Expand Down Expand Up @@ -363,7 +364,11 @@ bool Factory::ConfigParameters(std::string part, XrdOucStream& config )
return false;
}
}
else if (part == "nram")
else if (part == "prefetch" )
{
m_configuration.m_prefetch = true;
}
else if (part == "nram" )
{
m_configuration.m_NRamBuffers = ::atoi(config.GetWord());
}
Expand Down
3 changes: 3 additions & 0 deletions src/XrdFileCache/XrdFileCacheFactory.hh
Expand Up @@ -54,6 +54,7 @@ namespace XrdFileCache
m_diskUsageHWM(-1),
m_bufferSize(1024*1024),
m_NRamBuffers(8000),
m_prefetch(false),
m_hdfsbsize(128*1024*1024) {}

bool m_hdfsmode; //!< flag for enabling block-level operation
Expand All @@ -65,6 +66,8 @@ namespace XrdFileCache

long long m_bufferSize; //!< prefetch buffer size, default 1MB
int m_NRamBuffers; //!< number of total in-memory cache blocks
bool m_prefetch; //!< prefetch enable state

long long m_hdfsbsize; //!< used with m_hdfsmode, default 128MB
};

Expand Down

0 comments on commit 3f25cc5

Please sign in to comment.