CMS 3D CMS Logo

List of all members | Public Member Functions
DavixStorageMaker Class Reference
Inheritance diagram for DavixStorageMaker:
StorageMaker

Public Member Functions

bool check (const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=0) const override
 
std::unique_ptr< Storageopen (const std::string &proto, const std::string &path, int mode, AuxSettings const &aux) const override
 
- Public Member Functions inherited from StorageMaker
virtual std::unique_ptr< Storageopen (const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
 
virtual void stagein (const std::string &proto, const std::string &path, const AuxSettings &aux) const
 
 StorageMaker ()=default
 
virtual ~StorageMaker ()=default
 

Detailed Description

Definition at line 9 of file DavixStorageMaker.cc.

Member Function Documentation

bool DavixStorageMaker::check ( const std::string &  proto,
const std::string &  path,
const AuxSettings aux,
IOOffset size = 0 
) const
inlineoverridevirtual

Reimplemented from StorageMaker.

Definition at line 23 of file DavixStorageMaker.cc.

References cms::Exception::addContext(), HltBtagPostValidation_cff::c, DEFINE_EDM_PLUGIN, runTheMatrix::err, info(), findQualityFiles::size, and AlCaHLTBitMon_QueryRunRegistry::string.

26  {
27  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
28  Davix::DavixError *err = nullptr;
29  Davix::Context c;
30  Davix::DavPosix davixPosix(&c);
31  Davix::StatInfo info;
32  davixPosix.stat64(nullptr, newurl, &info, &err);
33  if (err) {
34  std::unique_ptr<Davix::DavixError> davixErrManaged(err);
35  cms::Exception ex("FileCheckError");
36  ex << "Check failed with error " << err->getErrMsg().c_str() << " and error code" << err->getStatus();
37  ex.addContext("Calling DavixFile::check()");
38  throw ex;
39  }
40  if (size) {
41  *size = info.size;
42  }
43  return true;
44  }
size
Write out results.
static const TGPicture * info(bool iBackgroundIsBlack)
std::unique_ptr<Storage> DavixStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode,
AuxSettings const &  aux 
) const
inlineoverride

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

Definition at line 13 of file DavixStorageMaker.cc.

References f, FrontierConditions_GlobalTag_cff::file, StorageFactory::get(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, eostools::move(), AlCaHLTBitMon_QueryRunRegistry::string, and StorageFactory::wrapNonLocalFile().

16  {
18  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
19  auto file = std::make_unique<DavixFile>(newurl, mode);
20  return f->wrapNonLocalFile(std::move(file), proto, std::string(), mode);
21  }
std::unique_ptr< Storage > wrapNonLocalFile(std::unique_ptr< Storage > s, const std::string &proto, const std::string &path, int mode) const
static const StorageFactory * get(void)
double f[11][100]
def move(src, dest)
Definition: eostools.py:511