![]() |
Project
|
#include <ByteSource.h>
Inherited by o2::aod::native::FailoverByteSource, o2::aod::native::HttpByteSource, o2::aod::native::LocalByteSource, o2::aod::native::PlannedByteSource, o2::aod::native::XRootDByteSource, and o2::aod::native::test::MemoryByteSource.
Public Member Functions | |
| virtual | ~ByteSource () |
| virtual uint64_t | size () const =0 |
| virtual void | readInto (uint64_t off, size_t len, void *dst)=0 |
| Throws IoError, or CorruptData when the range is past the end of the file. | |
| virtual void | readvInto (std::span< ReadRequest > requests)=0 |
| virtual std::span< const uint8_t > | tryMap (uint64_t off, size_t len) |
| A view of the bytes without copying them, if the backend can provide it. | |
| virtual bool | canMap () const |
| Whether tryMap() provides every range, so that nothing needs reading. | |
| virtual bool | isRemote () const |
| Whether each read is a network round trip, worth hiding behind decoding. | |
| virtual void | willNeed (uint64_t off, size_t len) |
| Hints that a range will be needed soon, or is no longer needed. | |
| virtual void | dontNeed (uint64_t off, size_t len) |
| virtual uint64_t | bytesRead () const =0 |
| virtual uint64_t | readCalls () const =0 |
| virtual std::string | url () const =0 |
| virtual std::string | replicaLabel () const |
| The label of the replica being read, for a source opened with openReplicas(). | |
Static Public Member Functions | |
| static std::unique_ptr< ByteSource > | open (std::string url, const Options &) |
| static std::unique_ptr< ByteSource > | openReplicas (std::vector< Replica > replicas, const Options &, std::function< void(std::string const &)> log={}) |
Random access to the bytes of a file. Everything above this is I/O-agnostic. The caller always owns the destination. Implementations are thread-safe for concurrent reads.
Definition at line 79 of file ByteSource.h.
|
virtualdefault |
|
pure virtual |
|
inlinevirtual |
Whether tryMap() provides every range, so that nothing needs reading.
Reimplemented in o2::aod::native::FailoverByteSource, and o2::aod::native::LocalByteSource.
Definition at line 90 of file ByteSource.h.
Reimplemented in o2::aod::native::FailoverByteSource, and o2::aod::native::LocalByteSource.
Definition at line 95 of file ByteSource.h.
|
inlinevirtual |
Whether each read is a network round trip, worth hiding behind decoding.
Reimplemented in o2::aod::native::FailoverByteSource, o2::aod::native::HttpByteSource, and o2::aod::native::XRootDByteSource.
Definition at line 92 of file ByteSource.h.
|
static |
Definition at line 28 of file ByteSource.cxx.
|
static |
Opens the first replica which opens, and on a read error retries it (Options::readRetries times, reopened) and then moves on to the next replica of the same size. log, if given, is told about every retry and every change of replica. Throws IoError when no replica is left.
Definition at line 63 of file ByteSource.cxx.
|
pure virtual |
|
pure virtual |
Throws IoError, or CorruptData when the range is past the end of the file.
Implemented in o2::aod::native::PlannedByteSource, o2::aod::native::FailoverByteSource, o2::aod::native::HttpByteSource, o2::aod::native::LocalByteSource, o2::aod::native::XRootDByteSource, and o2::aod::native::test::MemoryByteSource.
|
pure virtual |
|
inlinevirtual |
The label of the replica being read, for a source opened with openReplicas().
Reimplemented in o2::aod::native::FailoverByteSource.
Definition at line 100 of file ByteSource.h.
|
pure virtual |
|
inlinevirtual |
A view of the bytes without copying them, if the backend can provide it.
Reimplemented in o2::aod::native::PlannedByteSource, o2::aod::native::FailoverByteSource, o2::aod::native::LocalByteSource, and o2::aod::native::test::MemoryByteSource.
Definition at line 88 of file ByteSource.h.
|
pure virtual |
Hints that a range will be needed soon, or is no longer needed.
Reimplemented in o2::aod::native::FailoverByteSource, and o2::aod::native::LocalByteSource.
Definition at line 94 of file ByteSource.h.