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 22 of file DavixStorageMaker.cc.

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

23  {
24  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
25  Davix::DavixError *err = nullptr;
26  Davix::Context c;
27  Davix::DavPosix davixPosix(&c);
28  Davix::StatInfo info;
29  davixPosix.stat64(nullptr, newurl, &info, &err);
30  if (err) {
31  std::unique_ptr<Davix::DavixError> davixErrManaged(err);
32  cms::Exception ex("FileCheckError");
33  ex << "Check failed with error " << err->getErrMsg().c_str() << " and error code"
34  << err->getStatus();
35  ex.addContext("Calling DavixFile::check()");
36  throw ex;
37  }
38  if (size) {
39  *size = info.size;
40  }
41  return true;
42  }
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 14 of file DavixStorageMaker.cc.

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

15  {
17  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
18  auto file = std::make_unique<DavixFile>(newurl, mode);
19  return f->wrapNonLocalFile(std::move(file), proto, std::string(), mode);
20  }
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:510