14 : m_cacheHint(CACHE_HINT_AUTO_DETECT),
15 m_readHint(READ_HINT_AUTO),
18 m_temppath (
".:$TMPDIR"),
86 <<
"Considering path '" << s
87 <<
"', min free space " << minFreeSpace
88 <<
"GB for temp dir" << std::endl;
92 std::vector<std::string>
dirs;
93 dirs.reserve(
std::count(s.begin(), s.end(),
':') + 1);
97 size_t end = s.find(
':', begin);
98 if (end == std::string::npos)
100 dirs.push_back(s.substr(begin, end));
105 dirs.push_back(s.substr(begin, end - begin));
116 <<
"Using '" <<
m_tempdir <<
"' for temp dir" 136 auto itFound =
m_makers.find(proto);
138 return itFound->second.get();
147 return insertResult.first->second.get();
155 size_t p = url.find(
':');
156 if (p != std::string::npos)
158 protocol = url.substr(0,p);
159 rest = url.substr(p+1);
170 std::unique_ptr<Storage>
175 std::unique_ptr<Storage> ret;
176 std::unique_ptr<StorageAccount::Stamp> stats;
187 if (dynamic_cast<LocalCacheFile *>(storage.get()))
188 protocol =
"local-cache";
191 ret = std::make_unique<StorageAccountProxy>(protocol,
std::move(storage));
201 err.
addContext(
"Calling StorageFactory::open()");
204 err <<
"Failed to open the file '" << url <<
"'";
217 std::unique_ptr<StorageAccount::Stamp> stats;
227 if (stats) stats->tick();
232 <<
"Failed to stage in file '" << url <<
"' because:\n" 245 std::unique_ptr<StorageAccount::Stamp> stats;
255 if (stats) stats->tick();
260 <<
"Existence or size check for the file '" << url <<
"' failed because:\n" 268 std::unique_ptr<Storage>
bool check(const std::string &url, IOOffset *size=0) const
CacheHint cacheHint(void) const
std::unique_ptr< Storage > wrapNonLocalFile(std::unique_ptr< Storage > s, const std::string &proto, const std::string &path, int mode) const
bool enableAccounting(bool enabled)
static PluginManager & configure(const Config &)
std::string tempPath(void) const
void setTimeout(unsigned int timeout)
static PFTauRenderPlugin instance
virtual std::string explainSelf() const
void setReadHint(ReadHint value)
std::string message() const
unsigned int m_debugLevel
static bool isAvailable()
double tempMinFree(void) const
static const StorageFactory * get(void)
StorageMaker * getMaker(const std::string &proto) const
Container::value_type value_type
static StorageClassToken tokenForStorageClassName(std::string const &iName)
PluginManager::Config config()
void stagein(const std::string &url) const
std::string tempDir(void) const
unsigned int timeout(void) const
void addAdditionalInfo(std::string const &info)
bool isLocalPath(const std::string &path) const
void setDebugLevel(unsigned int level)
static Counter & counter(StorageClassToken token, Operation operation)
std::pair< std::string, std::string > findCachePath(const std::vector< std::string > &paths, double minFreeSpace) const
ReadHint readHint(void) const
void addContext(std::string const &context)
bool accounting(void) const
void setTempDir(const std::string &s, double minFreeSpace)
static StorageFactory s_instance
void setCacheHint(CacheHint value)
AuxSettings & setDebugLevel(unsigned int iLevel)
std::string m_unusableDirWarnings
T get(const Candidate &c)
AuxSettings & setTimeout(unsigned int iTime)
static StorageFactory * getToModify(void)
unsigned int debugLevel(void) const
std::unique_ptr< Storage > open(const std::string &url, int mode=IOFlags::OpenRead) const