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=0) 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 = 0 
) const
virtual

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

Definition at line 13 of file StorageMaker.cc.

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

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

17 {
18  // Fallback method is to open the file and check its
19  // size. Because grid jobs run in a directory where
20  // there is usually more space than in /tmp, and that
21  // directory is automatically cleaned up, open up the
22  // temporary files in the current directory. If the
23  // file is downloaded, it will delete itself in the
24  // destructor or close method.
25  bool found = false;
27  if (auto s = open (proto, path, mode, aux))
28  {
29  if (size)
30  *size = s->size ();
31 
32  s->close ();
33 
34  found = true;
35  }
36 
37  return found;
38 }
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 7 of file StorageMaker.cc.

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

10 {}