src
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
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Storage.h
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
printConversionInfo.aux
aux
Definition:
printConversionInfo.py:19
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
EnsembleCalibrationLA_cfg.path
path
Definition:
EnsembleCalibrationLA_cfg.py:27
IOFlags.h
edm::storage::IOFlags::OpenRead
Definition:
IOFlags.h:9
edm::storage
Definition:
XMLUtils.h:19
edm::storage::StorageMaker::stagein
virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const
Definition:
StorageMaker.cc:8
newFWLiteAna.found
found
Definition:
newFWLiteAna.py:117
StorageMaker.h
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
Generated for CMSSW Reference Manual by
1.8.14