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=nullptr) 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 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

◆ check()

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

Reimplemented from StorageMaker.

Definition at line 23 of file DavixStorageMaker.cc.

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  }

References cms::Exception::addContext(), c, submitPVResolutionJobs::err, info(), castor_dqm_sourceclient_file_cfg::path, findQualityFiles::size, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ open()

std::unique_ptr<Storage> DavixStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode,
AuxSettings const &  aux 
) const
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 13 of file DavixStorageMaker.cc.

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  }

References f, geometryDiff::file, StorageFactory::get(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, eostools::move(), castor_dqm_sourceclient_file_cfg::path, and AlCaHLTBitMon_QueryRunRegistry::string.

f
double f[11][100]
Definition: MuScleFitUtils.cc:78
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
StorageFactory::get
static const StorageFactory * get(void)
Definition: StorageFactory.cc:28
geometryDiff.file
file
Definition: geometryDiff.py:13
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
StorageFactory
Definition: StorageFactory.h:13
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
cms::Exception
Definition: Exception.h:70
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443