CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
XrdStorageMaker Class Reference
Inheritance diagram for XrdStorageMaker:
StorageMaker

Public Member Functions

virtual bool check (const std::string &proto, const std::string &path, IOOffset *size=0) override
 
virtual Storageopen (const std::string &proto, const std::string &path, int mode) override
 
virtual void setDebugLevel (unsigned int level) override
 
virtual void stagein (const std::string &proto, const std::string &path) override
 
- Public Member Functions inherited from StorageMaker
virtual void setTimeout (unsigned int timeout)
 
 StorageMaker (void)
 
virtual ~StorageMaker (void)
 

Detailed Description

Definition at line 9 of file XrdStorageMaker.cc.

Member Function Documentation

virtual bool XrdStorageMaker::check ( const std::string &  proto,
const std::string &  path,
IOOffset size = 0 
)
inlineoverridevirtual

Reimplemented from StorageMaker.

Definition at line 51 of file XrdStorageMaker.cc.

References flags, findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, and relmon_authenticated_wget::url.

54  {
55  std::string fullpath(proto + ":" + path);
56  XrdClientAdmin admin(fullpath.c_str());
57  if (! admin.Connect())
58  return false; // FIXME: Throw?
59 
60  long id;
61  long flags;
62  long modtime;
63  long long xrdsize;
64 
65  XrdOucString str(fullpath.c_str());
66  XrdClientUrlSet url(str);
67 
68  if (! admin.Stat(url.GetFile().c_str(), id, xrdsize, flags, modtime))
69  return false; // FIXME: Throw?
70 
71  *size = xrdsize;
72  return true;
73  }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
tuple path
else: Piece not in the list, fine.
tuple size
Write out results.
virtual Storage* XrdStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode 
)
inlineoverridevirtual

Open a storage object for the given URL (protocol + path), using the mode bits. No temporary files are downloaded.

Implements StorageMaker.

Definition at line 14 of file XrdStorageMaker.cc.

References StorageFactory::CACHE_HINT_STORAGE, StorageFactory::cacheHint(), f, mergeVDriftHistosByStation::file, StorageFactory::get(), IOFlags::OpenUnbuffered, StorageFactory::READ_HINT_UNBUFFERED, StorageFactory::readHint(), AlCaHLTBitMon_QueryRunRegistry::string, and StorageFactory::wrapNonLocalFile().

17  {
18  // The important part here is not the cache size (which will get
19  // auto-adjusted), but the fact the cache is set to something non-zero.
20  // If we don't do this before creating the XrdFile object, caching will be
21  // completely disabled, resulting in poor performance.
22  EnvPutInt(NAME_READCACHESIZE, 20*1024*1024);
23 
25  StorageFactory::ReadHint readHint = f->readHint();
26  StorageFactory::CacheHint cacheHint = f->cacheHint();
27 
29  || cacheHint == StorageFactory::CACHE_HINT_STORAGE)
30  mode &= ~IOFlags::OpenUnbuffered;
31  else
33 
34  std::string fullpath(proto + ":" + path);
35  Storage *file = new XrdFile (fullpath, mode);
36  return f->wrapNonLocalFile(file, proto, std::string(), mode);
37  }
CacheHint cacheHint(void) const
Storage * wrapNonLocalFile(Storage *s, const std::string &proto, const std::string &path, int mode)
static StorageFactory * get(void)
tuple path
else: Piece not in the list, fine.
double f[11][100]
ReadHint readHint(void) const
virtual void XrdStorageMaker::setDebugLevel ( unsigned int  level)
inlineoverridevirtual

Reimplemented from StorageMaker.

Definition at line 75 of file XrdStorageMaker.cc.

76  {
77  EnvPutInt("DebugLevel", level);
78  }
tuple level
Definition: testEve_cfg.py:34
virtual void XrdStorageMaker::stagein ( const std::string &  proto,
const std::string &  path 
)
inlineoverridevirtual

Reimplemented from StorageMaker.

Definition at line 39 of file XrdStorageMaker.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and relmon_authenticated_wget::url.

40  {
41  std::string fullpath(proto + ":" + path);
42  XrdClientAdmin admin(fullpath.c_str());
43  if (admin.Connect())
44  {
45  XrdOucString str(fullpath.c_str());
46  XrdClientUrlSet url(str);
47  admin.Prepare(url.GetFile().c_str(), kXR_stage | kXR_noerrs, 0);
48  }
49  }
tuple path
else: Piece not in the list, fine.