Skip to content

Commit

Permalink
XrdApps::JCache: add 'flat' config parameter to switch from user name…
Browse files Browse the repository at this point in the history
…space to a collapsed flat cache hierarchy using SHA256(path) as directory name hosting the journal
  • Loading branch information
apeters1971 committed Jul 24, 2024
1 parent 16c225b commit e5e4670
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/XrdApps/XrdClJCachePlugin/plugin/XrdClJCachePlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public:
itsi != config->end() ? std::stoll(std::string(itsi->second), 0, 10)
: 0);

auto itf = config->find("flat");
JCacheFile::SetFlatHierarchy(
itf != config->end() ? (itf->second == "true") || (itf->second == "1")
: false);

if (const char *v = getenv("XRD_JCACHE_CACHE")) {
JCacheFile::SetCache((std::string(v).length()) ? std::string(v) : "");
}
Expand Down Expand Up @@ -133,6 +138,12 @@ public:
(std::string(v).length()) ? std::stoll(std::string(v), 0, 10) : 0);
}

if (const char *v = getenv("XRD_JCACHE_FLAT")) {
JCacheFile::SetFlatHierarchy(
((std::string(v) == "true") || (std::string(v) == "1")) ? true
: false);
}

Env *env = DefaultEnv::GetEnv();
std::string appName;
env->GetString("AppName", appName);
Expand Down

0 comments on commit e5e4670

Please sign in to comment.