Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
Utilities
StorageFactory
src
StorageMaker.cc
Go to the documentation of this file.
1
#include "
Utilities/StorageFactory/interface/StorageMaker.h
"
2
#include "
Utilities/StorageFactory/interface/Storage.h
"
3
#include "
Utilities/StorageFactory/interface/IOFlags.h
"
4
#include <cstdlib>
5
6
using namespace
edm::storage;
7
8
void
StorageMaker::stagein
(
const
std::string
&
/*proto*/
,
const
std::string
&
/*path*/
,
const
AuxSettings
&)
const
{}
9
10
bool
StorageMaker::check
(
const
std::string
&proto,
11
const
std::string
&
path
,
12
const
AuxSettings
&
aux
,
13
IOOffset
*
size
/* = 0 */
)
const
{
14
// Fallback method is to open the file and check its
15
// size. Because grid jobs run in a directory where
16
// there is usually more space than in /tmp, and that
17
// directory is automatically cleaned up, open up the
18
// temporary files in the current directory. If the
19
// file is downloaded, it will delete itself in the
20
// destructor or close method.
21
bool
found
=
false
;
22
int
mode
=
IOFlags::OpenRead
|
IOFlags::OpenUnbuffered
;
23
if
(
auto
s
=
open
(proto, path, mode, aux)) {
24
if
(size)
25
*size =
s
->size();
26
27
s
->close();
28
29
found =
true
;
30
}
31
32
return
found
;
33
}
edm::storage::IOOffset
int64_t IOOffset
Definition:
IOTypes.h:20
edm::storage::IOFlags::OpenUnbuffered
Definition:
IOFlags.h:22
edm::storage::StorageMaker::AuxSettings
Definition:
StorageMaker.h:12
printConversionInfo.aux
tuple aux
Definition:
printConversionInfo.py:19
edm::storage::StorageMaker::stagein
virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const
Definition:
StorageMaker.cc:8
edm::storage::StorageMaker::check
virtual bool check(const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=nullptr) const
Definition:
StorageMaker.cc:10
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
universalConfigTemplate.mode
mode
Definition:
universalConfigTemplate.py:82
Storage.h
edm::storage::StorageMaker::open
virtual std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
IOFlags.h
fed_dqm_sourceclient-live_cfg.path
string path
Definition:
fed_dqm_sourceclient-live_cfg.py:47
alignCSCRings.s
list s
Definition:
alignCSCRings.py:92
edm::storage::IOFlags::OpenRead
Definition:
IOFlags.h:9
newFWLiteAna.found
found
Definition:
newFWLiteAna.py:118
StorageMaker.h
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:443
Generated for CMSSW Reference Manual by
1.8.5