#include <LocalCacheFile.h>
Public Member Functions | |
void | close (void) override |
void | flush (void) override |
LocalCacheFile (std::unique_ptr< Storage > base, const std::string &tmpdir="") | |
IOOffset | position (IOOffset offset, Relative whence=SET) override |
bool | prefetch (const IOPosBuffer *what, IOSize n) override |
IOSize | read (IOBuffer into, IOOffset pos) |
IOSize | read (void *into, IOSize n) override |
virtual IOSize | read (void *into, IOSize n, IOOffset pos) |
IOSize | read (void *into, IOSize n, IOOffset pos) override |
IOSize | readv (IOBuffer *into, IOSize n) override |
IOSize | readv (IOPosBuffer *into, IOSize n) override |
void | resize (IOOffset size) override |
IOSize | write (const void *from, IOSize n) override |
virtual IOSize | write (const void *from, IOSize n, IOOffset pos) |
IOSize | write (const void *from, IOSize n, IOOffset pos) override |
IOSize | write (IOBuffer from, IOOffset pos) |
IOSize | writev (const IOBuffer *from, IOSize n) override |
IOSize | writev (const IOPosBuffer *from, IOSize n) override |
~LocalCacheFile (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... | |
Private Member Functions | |
void | cache (IOOffset start, IOOffset end) |
Private Attributes | |
unsigned int | cacheCount_ |
unsigned int | cacheTotal_ |
bool | closedFile_ |
edm::propagate_const< std::unique_ptr< File > > | file_ |
IOOffset | image_ |
std::vector< char > | present_ |
edm::propagate_const< std::unique_ptr< Storage > > | storage_ |
Additional Inherited Members | |
Public Types inherited from Storage | |
enum | Relative { SET, CURRENT, END } |
Proxy class to copy a file locally in large chunks.
Definition at line 12 of file LocalCacheFile.h.
LocalCacheFile::LocalCacheFile | ( | std::unique_ptr< Storage > | base, |
const std::string & | tmpdir = "" |
||
) |
Definition at line 21 of file LocalCacheFile.cc.
References cms::Exception::addContext(), cacheTotal_, ztee::fd, file_, edm::errors::FileOpenError, image_, AlCaHLTBitMon_ParallelJobs::p, topSingleLeptonDQM_PU_cfi::pattern, present_, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.
|
override |
Definition at line 51 of file LocalCacheFile.cc.
Definition at line 53 of file LocalCacheFile.cc.
References cms::Exception::addContext(), cacheCount_, cacheTotal_, CHUNK_SIZE, closedFile_, MillePedeFileConverter_cfg::e, end, file_, edm::errors::FileReadError, image_, min(), present_, command_line::start, storage_, and svgfig::window().
Referenced by prefetch(), read(), and readv().
|
overridevirtual |
Reimplemented from Storage.
Definition at line 162 of file LocalCacheFile.cc.
References closedFile_, file_, and storage_.
Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().
|
overridevirtual |
Implements Storage.
Definition at line 156 of file LocalCacheFile.cc.
References file_, and hltrates_dqm_sourceclient-live_cfg::offset.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 169 of file LocalCacheFile.cc.
References cache(), end, file_, mps_fire::i, dqmiodumpmetadata::n, IOPosBuffer::offset(), and IOPosBuffer::size().
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 104 of file LocalCacheFile.cc.
References cache(), file_, and dqmiodumpmetadata::n.
IOSize Storage::read |
Definition at line 12 of file Storage.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 116 of file LocalCacheFile.cc.
References cache(), end, file_, mps_fire::i, dqmiodumpmetadata::n, Storage::size(), and command_line::start.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 126 of file LocalCacheFile.cc.
References cache(), end, mps_fire::i, dqmiodumpmetadata::n, IOPosBuffer::offset(), IOPosBuffer::size(), and storage_.
|
overridevirtual |
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 136 of file LocalCacheFile.cc.
References nowrite().
IOSize Storage::write |
Definition at line 44 of file Storage.cc.
IOSize Storage::write |
Definition at line 42 of file Storage.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 146 of file LocalCacheFile.cc.
References nowrite().
|
overridevirtual |
|
private |
Definition at line 43 of file LocalCacheFile.h.
Referenced by cache().
|
private |
Definition at line 44 of file LocalCacheFile.h.
Referenced by cache(), and LocalCacheFile().
|
private |
Definition at line 42 of file LocalCacheFile.h.
|
private |
Definition at line 40 of file LocalCacheFile.h.
Referenced by cache(), close(), LocalCacheFile(), position(), prefetch(), read(), and readv().
|
private |
Definition at line 38 of file LocalCacheFile.h.
Referenced by cache(), and LocalCacheFile().
|
private |
Definition at line 39 of file LocalCacheFile.h.
Referenced by cache(), and LocalCacheFile().
|
private |
Definition at line 41 of file LocalCacheFile.h.