Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
virtual
Storage
*
open
(
const
std::string
&proto,
16
const
std::string
&
path
,
17
int
mode
)
override
18
{
19
std::string
fullpath = proto +
":"
+
path
;
20
return
new
LStoreFile
(fullpath, mode);
21
}
22
23
/* I don't think this is necessary - Melo
24
virtual void stagein (const std::string &proto, const std::string &path)
25
{
26
std::string fullpath(proto + ":" + path);
27
XrdClientAdmin admin(fullpath.c_str());
28
if (admin.Connect())
29
{
30
XrdOucString str(fullpath.c_str());
31
XrdClientUrlSet url(str);
32
admin.Prepare(url.GetFile().c_str(), kXR_stage | kXR_noerrs, 0);
33
}
34
}
35
*/
36
37
virtual
bool
check
(
const
std::string
&proto,
38
const
std::string
&
path
,
39
IOOffset
*
size
= 0)
override
40
{
41
std::string
fullpath = proto +
":"
+
path
;
42
try
{
43
LStoreFile
fileObj( fullpath );
// = LStoreFile (fullpath);
44
*
size
= fileObj.
position
( 0,
Storage::END
);
45
}
catch
(
cms::Exception
&
e
) {
46
return
false
;
47
}
48
return
true
;
49
}
50
51
};
52
DEFINE_EDM_PLUGIN
(
StorageMakerFactory
,
LStoreStorageMaker
,
"lstore"
);
Storage::END
Definition:
Storage.h:23
MessageLogger.h
StorageMakerFactory.h
LStoreFile.h
getHLTPrescaleColumns.path
list path
Definition:
getHLTPrescaleColumns.py:16
Storage
Definition:
Storage.h:20
StorageMaker
Definition:
StorageMaker.h:8
alignBH_cfg.mode
list mode
Definition:
alignBH_cfg.py:7
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
LStoreStorageMaker::open
virtual Storage * open(const std::string &proto, const std::string &path, int mode) override
Definition:
LStoreStorageMaker.cc:15
edmplugin::PluginFactory
Definition:
PluginFactory.h:31
Exception.h
LStoreStorageMaker::check
virtual bool check(const std::string &proto, const std::string &path, IOOffset *size=0) override
Definition:
LStoreStorageMaker.cc:37
cms::Exception
Definition:
Exception.h:68
LStoreFile
Definition:
LStoreFile.h:8
IOOffset
int64_t IOOffset
Definition:
IOTypes.h:19
alignCSCRings.e
list e
Definition:
alignCSCRings.py:90
StorageFactory.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:101
LStoreFile::position
virtual IOOffset position(IOOffset offset, Relative whence=SET)
Definition:
LStoreFile.cc:326
StorageMaker.h
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:442
LStoreStorageMaker
Definition:
LStoreStorageMaker.cc:10
Generated for CMSSW Reference Manual by
1.8.5