CMS 3D CMS Logo

StorageAccountProxy.cc
Go to the documentation of this file.
2 
3 StorageAccountProxy::StorageAccountProxy(const std::string &storageClass, std::unique_ptr<Storage> baseStorage)
4  : m_baseStorage(std::move(baseStorage)),
5  m_token(StorageAccount::tokenForStorageClassName(storageClass)),
6  m_statsRead(StorageAccount::counter(m_token, StorageAccount::Operation::read)),
7  m_statsReadV(StorageAccount::counter(m_token, StorageAccount::Operation::readv)),
8  m_statsWrite(StorageAccount::counter(m_token, StorageAccount::Operation::write)),
9  m_statsWriteV(StorageAccount::counter(m_token, StorageAccount::Operation::writev)),
10  m_statsPosition(StorageAccount::counter(m_token, StorageAccount::Operation::position)),
11  m_statsPrefetch(StorageAccount::counter(m_token, StorageAccount::Operation::prefetch)) {
13  stats.tick();
14 }
15 
19  stats.tick();
20 }
21 
24  IOSize result = m_baseStorage->read(into, n);
25  stats.tick(result);
26  return result;
27 }
28 
31  IOSize result = m_baseStorage->read(into, n, pos);
32  stats.tick(result);
33  return result;
34 }
35 
38  IOSize result = m_baseStorage->readv(into, n);
39  stats.tick(result, n);
40  return result;
41 }
42 
45  IOSize result = m_baseStorage->readv(into, n);
46  stats.tick(result, n);
47  return result;
48 }
49 
52  IOSize result = m_baseStorage->write(from, n);
53  stats.tick(result);
54  return result;
55 }
56 
59  IOSize result = m_baseStorage->write(from, n, pos);
60  stats.tick(result);
61  return result;
62 }
63 
66  IOSize result = m_baseStorage->writev(from, n);
67  stats.tick(result, n);
68  return result;
69 }
70 
73  IOSize result = m_baseStorage->writev(from, n);
74  stats.tick(result, n);
75  return result;
76 }
77 
80  IOOffset result = m_baseStorage->position(offset, whence);
81  stats.tick();
82  return result;
83 }
84 
87  m_baseStorage->resize(size);
88  stats.tick();
89 }
90 
93  m_baseStorage->flush();
94  stats.tick();
95 }
96 
99  m_baseStorage->close();
100  stats.tick();
101 }
102 
105  bool value = m_baseStorage->prefetch(what, n);
106  if (value) {
107  IOSize total = 0;
108  for (IOSize i = 0; i < n; ++i)
109  total += what[i].size();
110  stats.tick(total);
111  }
112  return value;
113 }
StorageAccount::Operation::flush
Storage::size
virtual IOOffset size(void) const
Definition: Storage.cc:77
StorageAccountProxy::close
void close(void) override
Definition: StorageAccountProxy.cc:97
counter
Definition: counter.py:1
StorageAccountProxy::resize
void resize(IOOffset size) override
Definition: StorageAccountProxy.cc:85
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
pos
Definition: PixelAliasList.h:18
StorageAccountProxy::flush
void flush(void) override
Definition: StorageAccountProxy.cc:91
Storage::Relative
Relative
Definition: Storage.h:22
StorageAccountProxy::m_statsPrefetch
StorageAccount::Counter & m_statsPrefetch
Definition: StorageAccountProxy.h:52
StorageAccountProxy::m_statsWrite
StorageAccount::Counter & m_statsWrite
Definition: StorageAccountProxy.h:49
StorageAccountProxy::m_statsReadV
StorageAccount::Counter & m_statsReadV
Definition: StorageAccountProxy.h:48
StorageAccountProxy::m_statsPosition
StorageAccount::Counter & m_statsPosition
Definition: StorageAccountProxy.h:51
StorageAccount::Operation::close
StorageAccountProxy::~StorageAccountProxy
~StorageAccountProxy(void) override
Definition: StorageAccountProxy.cc:16
StorageAccountProxy::readv
IOSize readv(IOBuffer *into, IOSize n) override
Definition: StorageAccountProxy.cc:36
StorageAccountProxy.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StorageAccountProxy::m_baseStorage
edm::propagate_const< std::unique_ptr< Storage > > m_baseStorage
Definition: StorageAccountProxy.h:44
StorageAccount::Operation::resize
StorageAccount::Stamp
Definition: StorageAccount.h:93
StorageAccountProxy::prefetch
bool prefetch(const IOPosBuffer *what, IOSize n) override
Definition: StorageAccountProxy.cc:103
IOBuffer
Definition: IOBuffer.h:7
IOOffset
int64_t IOOffset
Definition: IOTypes.h:19
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
StorageAccount
Definition: StorageAccount.h:12
StorageAccountProxy::m_statsRead
StorageAccount::Counter & m_statsRead
Definition: StorageAccountProxy.h:47
value
Definition: value.py:1
StorageAccountProxy::write
IOSize write(const void *from, IOSize n) override
Definition: StorageAccountProxy.cc:50
dqmMemoryStats.stats
stats
Definition: dqmMemoryStats.py:134
readEcalDQMStatus.read
read
Definition: readEcalDQMStatus.py:38
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Storage::position
virtual IOOffset position(void) const
Definition: Storage.cc:72
IOInput::read
int read(void)
Definition: IOInput.cc:52
StorageAccount::counter
static Counter & counter(StorageClassToken token, Operation operation)
Definition: StorageAccount.cc:97
StorageAccount::Operation::destruct
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
IOPosBuffer
Definition: IOPosBuffer.h:7
StorageAccountProxy::releaseStorage
void releaseStorage()
Definition: StorageAccountProxy.h:42
StorageAccountProxy::m_statsWriteV
StorageAccount::Counter & m_statsWriteV
Definition: StorageAccountProxy.h:50
mps_fire.result
result
Definition: mps_fire.py:303
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
IOSize
size_t IOSize
Definition: IOTypes.h:14
StorageAccountProxy::StorageAccountProxy
StorageAccountProxy(const std::string &storageClass, std::unique_ptr< Storage > baseStorage)
Definition: StorageAccountProxy.cc:3
StorageAccountProxy::m_token
StorageAccount::StorageClassToken m_token
Definition: StorageAccountProxy.h:46
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
StorageAccount::Operation::construct
StorageAccountProxy::writev
IOSize writev(const IOBuffer *from, IOSize n) override
Definition: StorageAccountProxy.cc:64