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 ( )
default
virtual StorageMaker::~StorageMaker ( )
virtualdefault

Member Function Documentation

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

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

Definition at line 8 of file StorageMaker.cc.

References newFWLiteAna::found, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, open(), IOFlags::OpenRead, IOFlags::OpenUnbuffered, and alignCSCRings::s.

Referenced by StorageMaker::AuxSettings::setTimeout().

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 }
size
Write out results.
virtual std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
virtual std::unique_ptr<Storage> StorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode,
const AuxSettings aux 
) const
pure virtual
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.

Referenced by StorageMaker::AuxSettings::setTimeout().

6 {}