Skip to content

Commit

Permalink
Rename hdfs replated options: filefragmentmode->hdfsmode, filefragmen…
Browse files Browse the repository at this point in the history
…tsize - > hdfsbsize
  • Loading branch information
alja committed Dec 4, 2014
1 parent 6dc1bd9 commit 1399757
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/XrdFileCache/XrdFileCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ XrdOucCacheIO *Cache::Attach(XrdOucCacheIO *io, int Options)
m_attached++;
}
IO* cio;
if (Factory::GetInstance().RefConfiguration().m_prefetchFileBlocks)
if (Factory::GetInstance().RefConfiguration().m_hdfsmode)
cio = new IOFileBlock(*io, m_stats, *this);
else
cio = new IOEntireFile(*io, m_stats, *this);
Expand Down
12 changes: 6 additions & 6 deletions src/XrdFileCache/XrdFileCacheFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ bool Factory::Config(XrdSysLogger *logger, const char *config_filename, const ch
m_configuration.m_NRamBuffersRead, m_configuration.m_NRamBuffersPrefetch );


if (m_configuration.m_prefetchFileBlocks)
if (m_configuration.m_hdfsmode)
{
char buff2[512];
snprintf(buff2, sizeof(buff2), "\tpfc.filefragmentmode filefragmentsize %lld \n", m_configuration.m_fileFragmentSize);
snprintf(buff2, sizeof(buff2), "\tpfc.hdfsmode hdfsbsize %lld \n", m_configuration.m_hdfsbsize);
m_log.Emsg("", buff, buff2);
}
else {
Expand Down Expand Up @@ -326,17 +326,17 @@ bool Factory::ConfigParameters(std::string part, XrdOucStream& config )
{
m_configuration.m_NRamBuffersPrefetch = ::atoi(config.GetWord());
}
else if ( part == "filefragmentmode" )
else if ( part == "hdfsmode" )
{
m_configuration.m_prefetchFileBlocks = true;
m_configuration.m_hdfsmode = true;

const char* params = config.GetWord();
if (params) {
if (!strncmp("filefragmentsize", params, 9)) {
if (!strncmp("hdfsbsize", params, 9)) {
long long minBlSize = 128 * 1024;
long long maxBlSize = 1024 * 1024 * 1024;
params = config.GetWord();
if ( XrdOuca2x::a2sz(m_log, "Error getting file fragment size", params, &m_configuration.m_fileFragmentSize, minBlSize, maxBlSize))
if ( XrdOuca2x::a2sz(m_log, "Error getting file fragment size", params, &m_configuration.m_hdfsbsize, minBlSize, maxBlSize))
{
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/XrdFileCache/XrdFileCacheFactory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ namespace XrdFileCache
struct Configuration
{
Configuration() :
m_prefetchFileBlocks(false),
m_hdfsmode(false),
m_cache_dir("/var/tmp/xrootd-file-cache"),
m_username("nobody"),
m_lwm(0.95),
m_hwm(0.9),
m_bufferSize(1024*1024),
m_NRamBuffersRead(8),
m_NRamBuffersPrefetch(1),
m_fileFragmentSize(128*1024*1024) {}
m_hdfsbsize(128*1024*1024) {}

bool m_prefetchFileBlocks; //!< flag for enabling block-level operation
bool m_hdfsmode; //!< flag for enabling block-level operation
std::string m_cache_dir; //!< path of disk cache
std::string m_username; //!< username passed to oss plugin

Expand All @@ -65,7 +65,7 @@ namespace XrdFileCache
long long m_bufferSize; //!< prefetch buffer size, default 1MB
int m_NRamBuffersRead; //!< number of read in-memory cache blocks
int m_NRamBuffersPrefetch; //!< number of prefetch in-memory cache blocks
long long m_fileFragmentSize; //!< used with m_prefetchFileBlocks, default 128MB
long long m_hdfsbsize; //!< used with m_hdfsmode, default 128MB
};


Expand Down
2 changes: 1 addition & 1 deletion src/XrdFileCache/XrdFileCacheIOFileBlock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void *PrefetchRunnerBl(void * prefetch_void)
IOFileBlock::IOFileBlock(XrdOucCacheIO &io, XrdOucCacheStats &statsGlobal, Cache & cache)
: IO(io, statsGlobal, cache)
{
m_fileFragmentSize = Factory::GetInstance().RefConfiguration().m_fileFragmentSize;
m_fileFragmentSize = Factory::GetInstance().RefConfiguration().m_hdfsbs;
}

//______________________________________________________________________________
Expand Down

0 comments on commit 1399757

Please sign in to comment.