Main Page
Namespaces
Classes
Package Documentation
Utilities
LStoreAdaptor
plugins
LStoreStorageMaker.cc
Go to the documentation of this file.
1
#include "
Utilities/StorageFactory/interface/StorageMaker.h
"
2
#include "
Utilities/StorageFactory/interface/StorageMakerFactory.h
"
3
#include "
Utilities/StorageFactory/interface/StorageFactory.h
"
4
#include "
Utilities/LStoreAdaptor/interface/LStoreFile.h
"
5
#include "
FWCore/Utilities/interface/Exception.h
"
6
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
7
#include <unistd.h>
8
#include <iostream>
9
10
class
LStoreStorageMaker
:
public
StorageMaker
11
{
12
public
:
15
std::unique_ptr<Storage>
open
(
const
std::string
&proto,
16
const
std::string
&
path
,
17
int
mode
,
18
const
AuxSettings
&)
const override
19
{
20
std::string
fullpath = proto +
":"
+
path
;
21
return
std::make_unique<LStoreFile> (fullpath,
mode
);
22
}
23
24
/* I don't think this is necessary - Melo
25
virtual void stagein (const std::string &proto, const std::string &path)
26
{
27
std::string fullpath(proto + ":" + path);
28
XrdClientAdmin admin(fullpath.c_str());
29
if (admin.Connect())
30
{
31
XrdOucString str(fullpath.c_str());
32
XrdClientUrlSet url(str);
33
admin.Prepare(url.GetFile().c_str(), kXR_stage | kXR_noerrs, 0);
34
}
35
}
36
*/
37
38
bool
check
(
const
std::string
&proto,
39
const
std::string
&
path
,
40
const
AuxSettings
&,
41
IOOffset
*
size
=
nullptr
)
const override
42
{
43
std::string
fullpath = proto +
":"
+
path
;
44
try
{
45
LStoreFile
fileObj( fullpath );
// = LStoreFile (fullpath);
46
*
size
= fileObj.
position
( 0,
Storage::END
);
47
}
catch
(
cms::Exception
&
e
) {
48
return
false
;
49
}
50
return
true
;
51
}
52
53
};
54
DEFINE_EDM_PLUGIN
(
StorageMakerFactory
,
LStoreStorageMaker
,
"lstore"
);
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
Storage::END
Definition:
Storage.h:23
callgraph.path
path
Definition:
callgraph.py:39
MessageLogger.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
StorageMakerFactory.h
LStoreFile.h
LStoreFile::position
IOOffset position(IOOffset offset, Relative whence=SET) override
Definition:
LStoreFile.cc:326
StorageMaker::AuxSettings
Definition:
StorageMaker.h:12
LStoreStorageMaker::open
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override
Definition:
LStoreStorageMaker.cc:15
StorageMaker
Definition:
StorageMaker.h:9
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
edmplugin::PluginFactory
Definition:
PluginFactory.h:33
LStoreStorageMaker::check
bool check(const std::string &proto, const std::string &path, const AuxSettings &, IOOffset *size=0) const override
Definition:
LStoreStorageMaker.cc:38
Exception.h
cms::Exception
Definition:
Exception.h:68
LStoreFile
Definition:
LStoreFile.h:8
IOOffset
int64_t IOOffset
Definition:
IOTypes.h:19
StorageFactory.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:121
StorageMaker.h
LStoreStorageMaker
Definition:
LStoreStorageMaker.cc:10
Generated for CMSSW Reference Manual by
1.8.11