#include <XrdFile.h>
Public Member Functions | |
virtual void | abort (void) |
void | close (void) override |
virtual void | create (const char *name, bool exclusive=false, int perms=0666) |
virtual void | create (const std::string &name, bool exclusive=false, int perms=0666) |
virtual void | open (const char *name, int flags=IOFlags::OpenRead, int perms=0666) |
virtual void | open (const std::string &name, int flags=IOFlags::OpenRead, int perms=0666) |
IOOffset | position (IOOffset offset, Relative whence=SET) override |
virtual IOOffset | position (IOOffset offset, Relative whence=SET)=0 |
virtual IOOffset | position (void) const |
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) |
virtual IOSize | readv (IOBuffer *into, IOSize buffers) |
IOSize | readv (IOBuffer *into, IOSize n) override |
virtual IOSize | readv (IOPosBuffer *into, IOSize buffers) |
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)=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) |
XrdFile (const char *name, int flags=IOFlags::OpenRead, int perms=0666) | |
XrdFile (const std::string &name, int flags=IOFlags::OpenRead, int perms=0666) | |
XrdFile (IOFD fd) | |
XrdFile (void) | |
~XrdFile (void) override | |
Public Member Functions inherited from Storage | |
virtual bool | eof (void) const |
virtual void | flush (void) |
Storage & | operator= (const Storage &)=delete |
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 (const Storage &)=delete | |
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) |
virtual IOSize | writev (const IOPosBuffer *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) |
virtual IOSize | writev (const IOBuffer *from, IOSize buffers) |
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 | addConnection (cms::Exception &) |
std::shared_ptr< XrdCl::File > | getActiveFile () |
Private Attributes | |
bool | m_close |
std::string | m_name |
IOOffset | m_offset |
std::atomic< unsigned int > | m_op_count |
edm::propagate_const< std::shared_ptr< XrdAdaptor::RequestManager > > | m_requestmanager |
IOOffset | m_size |
Additional Inherited Members | |
Public Types inherited from Storage | |
enum | Relative { SET, CURRENT, END } |
XrdFile::XrdFile | ( | void | ) |
Definition at line 22 of file XrdFile.cc.
XrdFile::XrdFile | ( | IOFD | fd | ) |
XrdFile::XrdFile | ( | const char * | name, |
int | flags = IOFlags::OpenRead , |
||
int | perms = 0666 |
||
) |
Definition at line 24 of file XrdFile.cc.
References HLT_FULL_cff::flags, Skims_PA_cff::name, and open().
XrdFile::XrdFile | ( | const std::string & | name, |
int | flags = IOFlags::OpenRead , |
||
int | perms = 0666 |
||
) |
Definition at line 29 of file XrdFile.cc.
References HLT_FULL_cff::flags, Skims_PA_cff::name, and open().
|
override |
Definition at line 34 of file XrdFile.cc.
|
virtual |
Definition at line 168 of file XrdFile.cc.
References m_close, m_offset, m_requestmanager, and m_size.
|
private |
Definition at line 517 of file XrdFile.cc.
References edm::propagate_const< T >::get(), and m_requestmanager.
Referenced by open(), position(), read(), resize(), and write().
|
overridevirtual |
Reimplemented from Storage.
Definition at line 153 of file XrdFile.cc.
References edm::propagate_const< T >::get(), m_close, m_name, m_offset, m_requestmanager, and m_size.
Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().
|
virtual |
Definition at line 40 of file XrdFile.cc.
References generator_cfi::exclusive, Skims_PA_cff::name, open(), IOFlags::OpenCreate, IOFlags::OpenExclusive, IOFlags::OpenTruncate, and IOFlags::OpenWrite.
|
virtual |
Definition at line 46 of file XrdFile.cc.
References generator_cfi::exclusive, Skims_PA_cff::name, open(), IOFlags::OpenCreate, IOFlags::OpenExclusive, IOFlags::OpenTruncate, and IOFlags::OpenWrite.
|
private |
Returns a file handle from one of the active sources. Verifies the file is open and throws an exception as necessary.
Definition at line 505 of file XrdFile.cc.
References cms::Exception::addContext(), edm::propagate_const< T >::get(), m_close, m_name, and m_requestmanager.
|
virtual |
Definition at line 56 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), cms::cuda::assert(), geometryDiff::file, edm::errors::FileOpenError, HLT_FULL_cff::flags, getActiveFile(), m_close, m_name, m_offset, m_requestmanager, m_size, Skims_PA_cff::name, None, IOFlags::OpenAppend, IOFlags::OpenCreate, IOFlags::OpenExclusive, IOFlags::OpenRead, IOFlags::OpenTruncate, IOFlags::OpenWrite, CalibrationSummaryClient_cfi::sources, contentValuesCheck::ss, and mps_update::status.
|
virtual |
Definition at line 52 of file XrdFile.cc.
References HLT_FULL_cff::flags, Skims_PA_cff::name, and open().
Implements Storage.
Definition at line 457 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), cms::cuda::assert(), Storage::CURRENT, Storage::END, edm::propagate_const< T >::get(), m_offset, m_requestmanager, m_size, hltrates_dqm_sourceclient-live_cfg::offset, and Storage::SET.
virtual IOOffset Storage::position |
IOOffset Storage::position |
Definition at line 72 of file Storage.cc.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 448 of file XrdFile.cc.
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 176 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), edm::errors::FileReadError, edm::propagate_const< T >::get(), m_name, m_offset, m_requestmanager, and dqmiodumpmetadata::n.
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 190 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), edm::errors::FileReadError, m_name, m_requestmanager, min(), eostools::move(), dqmiodumpmetadata::n, mps_fire::result, and XRD_CL_MAX_READ_SIZE.
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.
IOSize IOInput::readv |
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. |
Definition at line 111 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 254 of file XrdFile.cc.
References data, mps_fire::i, dqmiodumpmetadata::n, IOBuffer::size(), and Storage::size().
IOSize Storage::readv |
Definition at line 24 of file Storage.cc.
|
overridevirtual |
Reimplemented from Storage.
Definition at line 270 of file XrdFile.cc.
References cms::Exception::addContext(), cms::cuda::assert(), edmScanValgrind::buffer, GetRecoTauVFromDQM_MC_cff::cl, submitPVResolutionJobs::count, data, mps_fire::end, cppFunctionSkipper::exception, edm::propagate_const< T >::get(), XrdAdaptor::XrootdException::getCode(), heavyIonCSV_trainingSettings::idx, m_op_count, m_requestmanager, dqmiodumpmetadata::n, submitPVValidationJobs::now, IOPosBuffer::offset(), hltrates_dqm_sourceclient-live_cfg::offset, IOInput::read(), mps_fire::result, IOPosBuffer::set_data(), IOPosBuffer::set_offset(), IOPosBuffer::set_size(), IOPosBuffer::size(), Storage::size(), command_line::start, edm::errors::StdException, UNLIKELY, cms::Exception::what(), XRD_CL_MAX_CHUNK, and XRD_CL_MAX_SIZE.
|
overridevirtual |
Implements Storage.
Definition at line 497 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), and m_name.
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 395 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), cms::cuda::assert(), geometryDiff::file, edm::errors::FileWriteError, getActiveFile(), m_name, m_offset, m_size, dqmiodumpmetadata::n, and alignCSCRings::s.
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 422 of file XrdFile.cc.
References addConnection(), cms::Exception::addContext(), cms::cuda::assert(), geometryDiff::file, edm::errors::FileWriteError, getActiveFile(), m_name, m_size, dqmiodumpmetadata::n, and alignCSCRings::s.
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.
|
private |
Definition at line 61 of file XrdFile.h.
Referenced by abort(), close(), getActiveFile(), open(), and ~XrdFile().
|
private |
Definition at line 62 of file XrdFile.h.
Referenced by close(), getActiveFile(), open(), read(), resize(), write(), and ~XrdFile().
|
private |
|
private |
|
private |
Definition at line 58 of file XrdFile.h.
Referenced by abort(), addConnection(), close(), getActiveFile(), open(), position(), read(), and readv().