Public Member Functions | |
virtual bool | check (const std::string &proto, const std::string &path, IOOffset *size=0) |
virtual Storage * | open (const std::string &proto, const std::string &path, int mode) |
virtual void | setTimeout (unsigned int timeout) |
virtual void | stagein (const std::string &proto, const std::string &path) |
Static Private Member Functions | |
static std::string | normalise (const std::string &proto, const std::string &path) |
Definition at line 9 of file DCacheStorageMaker.cc.
virtual bool DCacheStorageMaker::check | ( | const std::string & | proto, |
const std::string & | path, | ||
IOOffset * | size = 0 |
||
) | [inline, virtual] |
Reimplemented from StorageMaker.
Definition at line 61 of file DCacheStorageMaker.cc.
References normalise(), and findQualityFiles::size.
static std::string DCacheStorageMaker::normalise | ( | const std::string & | proto, |
const std::string & | path | ||
) | [inline, static, private] |
Return appropriate path for use with dcap library. If the path is in the URL form ([gsi]dcap://host:port/path), return the full URL as it is. If the path is /pnfs form (dcap:/pnfs/path), return only the path part, unless the protocol is 'gsidcap', in which case return the whole thing.
Definition at line 15 of file DCacheStorageMaker.cc.
References L1TEmulatorMonitor_cff::p.
virtual Storage* DCacheStorageMaker::open | ( | const std::string & | proto, |
const std::string & | path, | ||
int | mode | ||
) | [inline, virtual] |
Open a storage object for the given URL (protocol + path), using the mode bits. No temporary files are downloaded.
Implements StorageMaker.
Definition at line 32 of file DCacheStorageMaker.cc.
References StorageFactory::CACHE_HINT_STORAGE, StorageFactory::cacheHint(), f, dbtoweb::file, reco::get(), normalise(), IOFlags::OpenUnbuffered, StorageFactory::READ_HINT_UNBUFFERED, StorageFactory::readHint(), and StorageFactory::wrapNonLocalFile().
{ StorageFactory *f = StorageFactory::get(); StorageFactory::ReadHint readHint = f->readHint(); StorageFactory::CacheHint cacheHint = f->cacheHint(); if (readHint != StorageFactory::READ_HINT_UNBUFFERED || cacheHint == StorageFactory::CACHE_HINT_STORAGE) mode &= ~IOFlags::OpenUnbuffered; else mode |= IOFlags::OpenUnbuffered; Storage *file = new DCacheFile(normalise(proto, path), mode); return f->wrapNonLocalFile(file, proto, std::string(), mode); }
virtual void DCacheStorageMaker::setTimeout | ( | unsigned int | timeout | ) | [inline, virtual] |
Reimplemented from StorageMaker.
Definition at line 81 of file DCacheStorageMaker.cc.
{
if (timeout != 0) dc_setOpenTimeout(timeout);
}
virtual void DCacheStorageMaker::stagein | ( | const std::string & | proto, |
const std::string & | path | ||
) | [inline, virtual] |
Reimplemented from StorageMaker.
Definition at line 50 of file DCacheStorageMaker.cc.
References Exception, and normalise().
{ std::string npath = normalise(proto, path); if (dc_stage(npath.c_str(), 0, 0) != 0) throw cms::Exception("DCacheStorageMaker::stagein()") << "Cannot stage in file '" << npath << "', error was: " << dc_strerror(dc_errno) << " (dc_errno=" << dc_errno << ")"; }