CMS 3D CMS Logo

List of all members | Classes | Public Member Functions
StorageMaker Class Referenceabstract

#include <StorageMaker.h>

Inheritance diagram for StorageMaker:
DavixStorageMaker DCacheStorageMaker GsiFTPStorageMaker HttpStorageMaker LocalStorageMaker LStoreStorageMaker StormLcgGtStorageMaker StormStorageMaker XrdStorageMaker

Classes

struct  AuxSettings
 

Public Member Functions

virtual bool check (const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=nullptr) const
 
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 StorageMaker.h.

Constructor & Destructor Documentation

◆ StorageMaker()

StorageMaker::StorageMaker ( )
default

◆ ~StorageMaker()

virtual StorageMaker::~StorageMaker ( )
virtualdefault

Member Function Documentation

◆ check()

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

Reimplemented in XrdStorageMaker, DCacheStorageMaker, DavixStorageMaker, LStoreStorageMaker, StormLcgGtStorageMaker, StormStorageMaker, and LocalStorageMaker.

Definition at line 8 of file StorageMaker.cc.

11  {
12  // Fallback method is to open the file and check its
13  // size. Because grid jobs run in a directory where
14  // there is usually more space than in /tmp, and that
15  // directory is automatically cleaned up, open up the
16  // temporary files in the current directory. If the
17  // file is downloaded, it will delete itself in the
18  // destructor or close method.
19  bool found = false;
21  if (auto s = open(proto, path, mode, aux)) {
22  if (size)
23  *size = s->size();
24 
25  s->close();
26 
27  found = true;
28  }
29 
30  return found;
31 }

References printConversionInfo::aux, newFWLiteAna::found, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, open(), IOFlags::OpenRead, IOFlags::OpenUnbuffered, castor_dqm_sourceclient_file_cfg::path, alignCSCRings::s, and findQualityFiles::size.

◆ open()

virtual std::unique_ptr<Storage> StorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode,
const AuxSettings aux 
) const
pure virtual

◆ stagein()

void StorageMaker::stagein ( const std::string &  proto,
const std::string &  path,
const AuxSettings aux 
) const
virtual

Reimplemented in XrdStorageMaker, and DCacheStorageMaker.

Definition at line 6 of file StorageMaker.cc.

6 {}
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
alignCSCRings.s
s
Definition: alignCSCRings.py:92
IOFlags::OpenRead
Definition: IOFlags.h:7
StorageMaker::open
virtual std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
IOFlags::OpenUnbuffered
Definition: IOFlags.h:20
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443