#include <StorageAccountProxy.h>
Public Member Functions | |
void | close (void) override |
void | flush (void) override |
IOOffset | position (IOOffset offset, Relative whence=SET) override |
bool | prefetch (const IOPosBuffer *what, IOSize n) override |
IOSize | read (IOBuffer into) |
IOSize | read (IOBuffer into, IOOffset pos) |
IOSize | read (void *into, IOSize n) override |
virtual IOSize | read (void *into, IOSize n)=0 |
virtual IOSize | read (void *into, IOSize n, IOOffset pos) |
IOSize | read (void *into, IOSize n, IOOffset pos) override |
int | read (void) |
IOSize | readv (IOBuffer *into, IOSize n) override |
IOSize | readv (IOPosBuffer *into, IOSize n) override |
void | resize (IOOffset size) override |
StorageAccountProxy (const std::string &storageClass, std::unique_ptr< Storage > baseStorage) | |
IOSize | write (const void *from, IOSize n) override |
virtual IOSize | write (const void *from, IOSize n)=0 |
virtual IOSize | write (const void *from, IOSize n, IOOffset pos) |
IOSize | write (const void *from, IOSize n, IOOffset pos) override |
IOSize | write (IOBuffer from) |
IOSize | write (IOBuffer from, IOOffset pos) |
IOSize | write (unsigned char byte) |
IOSize | writev (const IOBuffer *from, IOSize n) override |
IOSize | writev (const IOPosBuffer *from, IOSize n) override |
~StorageAccountProxy (void) override | |
Public Member Functions inherited from Storage | |
virtual bool | eof (void) const |
virtual IOOffset | position (void) const |
IOSize | read (IOBuffer into) |
IOSize | read (IOBuffer into, IOOffset pos) |
virtual IOSize | read (void *into, IOSize n)=0 |
int | read (void) |
virtual IOSize | readv (IOBuffer *into, IOSize buffers) |
virtual void | rewind (void) |
virtual IOOffset | size (void) const |
Storage (void) | |
virtual IOSize | write (const void *from, IOSize n)=0 |
IOSize | write (IOBuffer from) |
IOSize | write (IOBuffer from, IOOffset pos) |
IOSize | write (unsigned char byte) |
virtual IOSize | writev (const IOBuffer *from, IOSize buffers) |
~Storage (void) override | |
Public Member Functions inherited from IOInput | |
IOSize | read (IOBuffer into) |
int | read (void) |
IOSize | xread (IOBuffer into) |
IOSize | xread (void *into, IOSize n) |
IOSize | xreadv (IOBuffer *into, IOSize buffers) |
virtual | ~IOInput (void) |
Destruct the stream. A no-op. More... | |
Public Member Functions inherited from IOOutput | |
IOSize | write (IOBuffer from) |
IOSize | write (unsigned char byte) |
IOSize | xwrite (const void *from, IOSize n) |
IOSize | xwrite (IOBuffer from) |
IOSize | xwritev (const IOBuffer *from, IOSize buffers) |
virtual | ~IOOutput (void) |
Destruct the stream. A no-op. More... | |
Protected Member Functions | |
void | releaseStorage () |
Additional Inherited Members | |
Public Types inherited from Storage | |
enum | Relative { SET, CURRENT, END } |
Proxy class that wraps SEAL's Storage class with one that ticks StorageAccount counters for significant operations. The returned Storage objects from StorageMaker are automatically wrapped with this class.
Future improvement would be to implement more methods so that the wrapper itself doesn't cause peroformance degradation if the base storage does actually implement "sophisticated" features.
Definition at line 18 of file StorageAccountProxy.h.
StorageAccountProxy::StorageAccountProxy | ( | const std::string & | storageClass, |
std::unique_ptr< Storage > | baseStorage | ||
) |
Definition at line 3 of file StorageAccountProxy.cc.
References StorageAccount::construct, StorageAccount::counter(), m_token, and dqmMemoryStats::stats.
|
override |
Definition at line 16 of file StorageAccountProxy.cc.
References StorageAccount::counter(), StorageAccount::destruct, m_token, releaseStorage(), and dqmMemoryStats::stats.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 97 of file StorageAccountProxy.cc.
References StorageAccount::close, StorageAccount::counter(), m_baseStorage, m_token, and dqmMemoryStats::stats.
Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().
|
overridevirtual |
Reimplemented from Storage.
Definition at line 91 of file StorageAccountProxy.cc.
References StorageAccount::counter(), StorageAccount::flush, m_baseStorage, m_token, and dqmMemoryStats::stats.
Implements Storage.
Definition at line 78 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsPosition, hltrates_dqm_sourceclient-live_cfg::offset, mps_fire::result, and dqmMemoryStats::stats.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 103 of file StorageAccountProxy.cc.
References mps_fire::i, m_baseStorage, m_statsPrefetch, dqmiodumpmetadata::n, Storage::size(), dqmMemoryStats::stats, dqmMemoryStats::total, and relativeConstraints::value.
IOSize IOInput::read |
Read from the input stream into the buffer starting at into and of size n.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
The base class implementation simply forwards the call to read(void *, IOSize) method.
In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
Definition at line 80 of file IOInput.cc.
IOSize Storage::read |
Definition at line 10 of file Storage.cc.
Read into into at most n number of bytes.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
Implements IOInput.
Definition at line 22 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsRead, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
IOSize IOInput::read |
Read into into at most n number of bytes.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
IOSize Storage::read |
Definition at line 12 of file Storage.cc.
Reimplemented from Storage.
Definition at line 29 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsRead, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
int IOInput::read |
Read the next single byte from the input stream and return it as an unsigned
char
cast to an int
, -1 to indicate end of intput data.
If this is a blocking stream, the call will block until the byte can be read, end of data is reached, or an exception is thrown. For a non-blocking input a character is returned if one is available, otherwise an exception is thrown.
The base class implementation simply forwards the call to read(void *, IOSize) method.
unsigned char
to an int
(in range 0...255, inclusive) if one could be read, or -1
to indicate end of input data.In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
Definition at line 52 of file IOInput.cc.
Read from the input stream into multiple scattered buffers. There are buffers to fill in an array starting at into; the memory those buffers occupy does not need to be contiguous. The buffers are filled in the order given, eac buffer is filled fully before the subsequent buffers.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
The base class implementation uses read(void *, IOSize) method, but derived classes may implement a more efficient alternative.
In | case of error, a #IOError exception is thrown. However if some data has already been read, the error is swallowed and the method returns the data read so far. It is assumed that persistent errors will occur anyway on the next read and sporadic errors like stream becoming unvailable can be ignored. Use xread() if a different policy is desirable. |
Reimplemented from IOInput.
Definition at line 36 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsReadV, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 43 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsReadV, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
|
inlineprotected |
Definition at line 42 of file StorageAccountProxy.h.
References edm::get_underlying_safe(), and m_baseStorage.
Referenced by ~StorageAccountProxy().
|
overridevirtual |
Implements Storage.
Definition at line 85 of file StorageAccountProxy.cc.
References StorageAccount::counter(), m_baseStorage, m_token, StorageAccount::resize, Storage::size(), and dqmMemoryStats::stats.
Write n bytes of data starting at address from.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
Implements IOOutput.
Definition at line 50 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWrite, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
IOSize IOOutput::write |
Write n bytes of data starting at address from.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
IOSize Storage::write |
Definition at line 44 of file Storage.cc.
Reimplemented from Storage.
Definition at line 57 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWrite, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
IOSize IOOutput::write |
Write to the output stream the buffer from. This method is simply redirected to write(const void *, IOSize).
Note that derived classes should not normally call this method, as it simply routes the call back to derived class through the other virtual functions. Use this method only at the "outside edge" when transferring calls from one object to another, not in up/down calls in the inheritance tree.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
Definition at line 59 of file IOOutput.cc.
IOSize Storage::write |
Definition at line 42 of file Storage.cc.
IOSize IOOutput::write |
Write a single byte to the output stream. This method is simply redirected to write(const void *, IOSize).
Note that derived classes should not normally call this method, as it simply routes the call back to derived class through the other virtual functions. Use this method only at the "outside edge" when transferring calls from one object to another, not in up/down calls in the inheritance tree.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – zero will be returned. |
Definition at line 39 of file IOOutput.cc.
Write to the output stream from multiple buffers. There are buffers to fill in an array starting at from. The buffers are filled in the order given, each buffer fully before the subsequent buffers. The method uses write(const void *, IOSize), but may be implemented more efficiently in derived classes.
Note that derived classes should not normally call this method, as it simply routes the call back to derived class through the other virtual functions. Use this method only at the "outside edge" when transferring calls from one object to another, not in up/down calls in the inheritance tree.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
Reimplemented from IOOutput.
Definition at line 64 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWriteV, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 71 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWriteV, dqmiodumpmetadata::n, mps_fire::result, and dqmMemoryStats::stats.
|
protected |
Definition at line 44 of file StorageAccountProxy.h.
Referenced by close(), flush(), position(), prefetch(), read(), readv(), releaseStorage(), resize(), write(), and writev().
|
protected |
Definition at line 51 of file StorageAccountProxy.h.
Referenced by position().
|
protected |
Definition at line 52 of file StorageAccountProxy.h.
Referenced by prefetch().
|
protected |
Definition at line 47 of file StorageAccountProxy.h.
Referenced by read().
|
protected |
Definition at line 48 of file StorageAccountProxy.h.
Referenced by readv().
|
protected |
Definition at line 49 of file StorageAccountProxy.h.
Referenced by write().
|
protected |
Definition at line 50 of file StorageAccountProxy.h.
Referenced by writev().
|
protected |
Definition at line 46 of file StorageAccountProxy.h.
Referenced by close(), flush(), resize(), StorageAccountProxy(), and ~StorageAccountProxy().